@almadar/std 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/behaviors/exports/atoms/std-agent-activity-log.orb +5 -45
  2. package/behaviors/exports/atoms/std-agent-chat-thread.orb +5 -55
  3. package/behaviors/exports/atoms/std-agent-classifier.orb +8 -8
  4. package/behaviors/exports/atoms/std-agent-completion.orb +8 -8
  5. package/behaviors/exports/atoms/std-agent-context-window.orb +5 -4
  6. package/behaviors/exports/atoms/std-agent-conversation.orb +5 -71
  7. package/behaviors/exports/atoms/std-agent-memory.orb +13 -127
  8. package/behaviors/exports/atoms/std-agent-provider.orb +8 -8
  9. package/behaviors/exports/atoms/std-agent-search.orb +6 -27
  10. package/behaviors/exports/atoms/std-agent-session.orb +11 -85
  11. package/behaviors/exports/atoms/std-agent-step-progress.orb +5 -4
  12. package/behaviors/exports/atoms/std-agent-token-gauge.orb +5 -4
  13. package/behaviors/exports/atoms/std-agent-tool-call.orb +8 -8
  14. package/behaviors/exports/atoms/std-async.orb +5 -8
  15. package/behaviors/exports/atoms/std-autoregressive.orb +4 -2
  16. package/behaviors/exports/atoms/std-browse.orb +5 -4
  17. package/behaviors/exports/atoms/std-cache-aside.orb +5 -8
  18. package/behaviors/exports/atoms/std-calendar.orb +5 -4
  19. package/behaviors/exports/atoms/std-circuit-breaker.orb +5 -4
  20. package/behaviors/exports/atoms/std-collision.orb +5 -4
  21. package/behaviors/exports/atoms/std-combat-log.orb +5 -4
  22. package/behaviors/exports/atoms/std-combat.orb +5 -4
  23. package/behaviors/exports/atoms/std-confirmation.orb +10 -4
  24. package/behaviors/exports/atoms/std-dialogue-box.orb +5 -4
  25. package/behaviors/exports/atoms/std-display.orb +5 -4
  26. package/behaviors/exports/atoms/std-drawer.orb +5 -4
  27. package/behaviors/exports/atoms/std-filter.orb +5 -4
  28. package/behaviors/exports/atoms/std-flip-card.orb +5 -4
  29. package/behaviors/exports/atoms/std-gallery.orb +5 -4
  30. package/behaviors/exports/atoms/std-game-audio.orb +5 -4
  31. package/behaviors/exports/atoms/std-game-canvas2d.orb +4 -2
  32. package/behaviors/exports/atoms/std-game-canvas3d.orb +4 -2
  33. package/behaviors/exports/atoms/std-game-hud.orb +5 -4
  34. package/behaviors/exports/atoms/std-game-menu.orb +5 -4
  35. package/behaviors/exports/atoms/std-game-over-screen.orb +5 -4
  36. package/behaviors/exports/atoms/std-gameflow.orb +5 -4
  37. package/behaviors/exports/atoms/std-input.orb +5 -4
  38. package/behaviors/exports/atoms/std-inventory-panel.orb +5 -8
  39. package/behaviors/exports/atoms/std-isometric-canvas.orb +5 -4
  40. package/behaviors/exports/atoms/std-loading.orb +5 -4
  41. package/behaviors/exports/atoms/std-modal.orb +89 -4
  42. package/behaviors/exports/atoms/std-movement.orb +5 -4
  43. package/behaviors/exports/atoms/std-notification.orb +5 -4
  44. package/behaviors/exports/atoms/std-overworld.orb +5 -4
  45. package/behaviors/exports/atoms/std-pagination.orb +5 -4
  46. package/behaviors/exports/atoms/std-physics2d.orb +5 -4
  47. package/behaviors/exports/atoms/std-platformer-canvas.orb +5 -4
  48. package/behaviors/exports/atoms/std-quest.orb +5 -8
  49. package/behaviors/exports/atoms/std-rate-limiter.orb +5 -4
  50. package/behaviors/exports/atoms/std-rating.orb +5 -4
  51. package/behaviors/exports/atoms/std-score-board.orb +5 -4
  52. package/behaviors/exports/atoms/std-score.orb +5 -4
  53. package/behaviors/exports/atoms/std-search.orb +5 -4
  54. package/behaviors/exports/atoms/std-selection.orb +5 -4
  55. package/behaviors/exports/atoms/std-service-custom-bearer.orb +5 -15
  56. package/behaviors/exports/atoms/std-service-custom-header.orb +5 -17
  57. package/behaviors/exports/atoms/std-service-custom-noauth.orb +5 -11
  58. package/behaviors/exports/atoms/std-service-custom-query.orb +5 -17
  59. package/behaviors/exports/atoms/std-service-email.orb +5 -4
  60. package/behaviors/exports/atoms/std-service-github.orb +5 -4
  61. package/behaviors/exports/atoms/std-service-llm.orb +5 -4
  62. package/behaviors/exports/atoms/std-service-oauth.orb +5 -4
  63. package/behaviors/exports/atoms/std-service-redis.orb +5 -4
  64. package/behaviors/exports/atoms/std-service-storage.orb +5 -4
  65. package/behaviors/exports/atoms/std-service-stripe.orb +5 -4
  66. package/behaviors/exports/atoms/std-service-twilio.orb +5 -4
  67. package/behaviors/exports/atoms/std-service-youtube.orb +5 -4
  68. package/behaviors/exports/atoms/std-simulation-canvas.orb +5 -4
  69. package/behaviors/exports/atoms/std-sort.orb +5 -4
  70. package/behaviors/exports/atoms/std-sprite.orb +5 -4
  71. package/behaviors/exports/atoms/std-tabs.orb +5 -4
  72. package/behaviors/exports/atoms/std-text-effects.orb +5 -4
  73. package/behaviors/exports/atoms/std-theme.orb +5 -4
  74. package/behaviors/exports/atoms/std-timer.orb +5 -4
  75. package/behaviors/exports/atoms/std-undo.orb +5 -4
  76. package/behaviors/exports/atoms/std-upload.orb +5 -4
  77. package/behaviors/exports/atoms/std-validate-on-save.orb +5 -32
  78. package/behaviors/exports/atoms/std-wizard.orb +5 -4
  79. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  80. package/behaviors/exports/molecules/std-agent-learner.orb +608 -938
  81. package/behaviors/exports/molecules/std-agent-planner.orb +613 -961
  82. package/behaviors/exports/molecules/std-agent-rag.orb +586 -915
  83. package/behaviors/exports/molecules/std-agent-tool-loop.orb +915 -2846
  84. package/behaviors/exports/molecules/std-builder-game.orb +5 -4
  85. package/behaviors/exports/molecules/std-cart.orb +196 -307
  86. package/behaviors/exports/molecules/std-classifier-game.orb +5 -4
  87. package/behaviors/exports/molecules/std-debugger-game.orb +5 -4
  88. package/behaviors/exports/molecules/std-detail.orb +309 -467
  89. package/behaviors/exports/molecules/std-event-handler-game.orb +5 -4
  90. package/behaviors/exports/molecules/std-form-advanced.orb +5 -8
  91. package/behaviors/exports/molecules/std-geospatial.orb +363 -539
  92. package/behaviors/exports/molecules/std-inventory.orb +390 -720
  93. package/behaviors/exports/molecules/std-list.orb +526 -1156
  94. package/behaviors/exports/molecules/std-messaging.orb +295 -452
  95. package/behaviors/exports/molecules/std-negotiator-game.orb +5 -4
  96. package/behaviors/exports/molecules/std-platformer-game.orb +5 -4
  97. package/behaviors/exports/molecules/std-puzzle-game.orb +5 -4
  98. package/behaviors/exports/molecules/std-quiz.orb +5 -4
  99. package/behaviors/exports/molecules/std-sequencer-game.orb +5 -4
  100. package/behaviors/exports/molecules/std-service-content-pipeline.orb +5 -4
  101. package/behaviors/exports/molecules/std-service-custom-api-tester.orb +5 -42
  102. package/behaviors/exports/molecules/std-service-devops-toolkit.orb +5 -4
  103. package/behaviors/exports/molecules/std-service-notification-hub.orb +5 -4
  104. package/behaviors/exports/molecules/std-service-payment-flow.orb +5 -4
  105. package/behaviors/exports/molecules/std-simulator-game.orb +5 -4
  106. package/behaviors/exports/molecules/std-turn-based-battle.orb +5 -4
  107. package/behaviors/exports/organisms/std-agent-assistant.orb +15 -143
  108. package/behaviors/exports/organisms/std-agent-builder.orb +814 -1476
  109. package/behaviors/exports/organisms/std-agent-pipeline.orb +785 -1567
  110. package/behaviors/exports/organisms/std-agent-reviewer.orb +299 -502
  111. package/behaviors/exports/organisms/std-agent-tutor.orb +306 -493
  112. package/behaviors/exports/organisms/std-api-gateway.orb +284 -626
  113. package/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  114. package/behaviors/exports/organisms/std-booking-system.orb +1422 -2160
  115. package/behaviors/exports/organisms/std-cicd-pipeline.orb +274 -617
  116. package/behaviors/exports/organisms/std-cms.orb +1274 -1972
  117. package/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  118. package/behaviors/exports/organisms/std-crm.orb +999 -1775
  119. package/behaviors/exports/organisms/std-devops-dashboard.orb +284 -638
  120. package/behaviors/exports/organisms/std-ecommerce.orb +1653 -2398
  121. package/behaviors/exports/organisms/std-finance-tracker.orb +340 -684
  122. package/behaviors/exports/organisms/std-healthcare.orb +984 -1838
  123. package/behaviors/exports/organisms/std-helpdesk.orb +340 -744
  124. package/behaviors/exports/organisms/std-hr-portal.orb +1401 -2151
  125. package/behaviors/exports/organisms/std-iot-dashboard.orb +284 -626
  126. package/behaviors/exports/organisms/std-lms.orb +284 -632
  127. package/behaviors/exports/organisms/std-logic-training.orb +4 -4
  128. package/behaviors/exports/organisms/std-platformer-app.orb +15 -98
  129. package/behaviors/exports/organisms/std-project-manager.orb +970 -1774
  130. package/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  131. package/behaviors/exports/organisms/std-realtime-chat.orb +364 -714
  132. package/behaviors/exports/organisms/std-rpg-game.orb +15 -102
  133. package/behaviors/exports/organisms/std-service-marketplace.orb +1589 -2361
  134. package/behaviors/exports/organisms/std-service-research-assistant.orb +4 -15
  135. package/behaviors/exports/organisms/std-social-feed.orb +62 -66
  136. package/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  137. package/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  138. package/behaviors/exports/organisms/std-trading-dashboard.orb +274 -620
  139. package/dist/behaviors/exports/atoms/std-agent-activity-log.orb +5 -45
  140. package/dist/behaviors/exports/atoms/std-agent-chat-thread.orb +5 -55
  141. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +8 -8
  142. package/dist/behaviors/exports/atoms/std-agent-completion.orb +8 -8
  143. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +5 -4
  144. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +5 -71
  145. package/dist/behaviors/exports/atoms/std-agent-memory.orb +13 -127
  146. package/dist/behaviors/exports/atoms/std-agent-provider.orb +8 -8
  147. package/dist/behaviors/exports/atoms/std-agent-search.orb +6 -27
  148. package/dist/behaviors/exports/atoms/std-agent-session.orb +11 -85
  149. package/dist/behaviors/exports/atoms/std-agent-step-progress.orb +5 -4
  150. package/dist/behaviors/exports/atoms/std-agent-token-gauge.orb +5 -4
  151. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +8 -8
  152. package/dist/behaviors/exports/atoms/std-async.orb +5 -8
  153. package/dist/behaviors/exports/atoms/std-autoregressive.orb +4 -2
  154. package/dist/behaviors/exports/atoms/std-browse.orb +5 -4
  155. package/dist/behaviors/exports/atoms/std-cache-aside.orb +5 -8
  156. package/dist/behaviors/exports/atoms/std-calendar.orb +5 -4
  157. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +5 -4
  158. package/dist/behaviors/exports/atoms/std-collision.orb +5 -4
  159. package/dist/behaviors/exports/atoms/std-combat-log.orb +5 -4
  160. package/dist/behaviors/exports/atoms/std-combat.orb +5 -4
  161. package/dist/behaviors/exports/atoms/std-confirmation.orb +10 -4
  162. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +5 -4
  163. package/dist/behaviors/exports/atoms/std-display.orb +5 -4
  164. package/dist/behaviors/exports/atoms/std-drawer.orb +5 -4
  165. package/dist/behaviors/exports/atoms/std-filter.orb +5 -4
  166. package/dist/behaviors/exports/atoms/std-flip-card.orb +5 -4
  167. package/dist/behaviors/exports/atoms/std-gallery.orb +5 -4
  168. package/dist/behaviors/exports/atoms/std-game-audio.orb +5 -4
  169. package/dist/behaviors/exports/atoms/std-game-canvas2d.orb +4 -2
  170. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +4 -2
  171. package/dist/behaviors/exports/atoms/std-game-hud.orb +5 -4
  172. package/dist/behaviors/exports/atoms/std-game-menu.orb +5 -4
  173. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +5 -4
  174. package/dist/behaviors/exports/atoms/std-gameflow.orb +5 -4
  175. package/dist/behaviors/exports/atoms/std-input.orb +5 -4
  176. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +5 -8
  177. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +5 -4
  178. package/dist/behaviors/exports/atoms/std-loading.orb +5 -4
  179. package/dist/behaviors/exports/atoms/std-modal.orb +89 -4
  180. package/dist/behaviors/exports/atoms/std-movement.orb +5 -4
  181. package/dist/behaviors/exports/atoms/std-notification.orb +5 -4
  182. package/dist/behaviors/exports/atoms/std-overworld.orb +5 -4
  183. package/dist/behaviors/exports/atoms/std-pagination.orb +5 -4
  184. package/dist/behaviors/exports/atoms/std-physics2d.orb +5 -4
  185. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +5 -4
  186. package/dist/behaviors/exports/atoms/std-quest.orb +5 -8
  187. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +5 -4
  188. package/dist/behaviors/exports/atoms/std-rating.orb +5 -4
  189. package/dist/behaviors/exports/atoms/std-score-board.orb +5 -4
  190. package/dist/behaviors/exports/atoms/std-score.orb +5 -4
  191. package/dist/behaviors/exports/atoms/std-search.orb +5 -4
  192. package/dist/behaviors/exports/atoms/std-selection.orb +5 -4
  193. package/dist/behaviors/exports/atoms/std-service-custom-bearer.orb +5 -15
  194. package/dist/behaviors/exports/atoms/std-service-custom-header.orb +5 -17
  195. package/dist/behaviors/exports/atoms/std-service-custom-noauth.orb +5 -11
  196. package/dist/behaviors/exports/atoms/std-service-custom-query.orb +5 -17
  197. package/dist/behaviors/exports/atoms/std-service-email.orb +5 -4
  198. package/dist/behaviors/exports/atoms/std-service-github.orb +5 -4
  199. package/dist/behaviors/exports/atoms/std-service-llm.orb +5 -4
  200. package/dist/behaviors/exports/atoms/std-service-oauth.orb +5 -4
  201. package/dist/behaviors/exports/atoms/std-service-redis.orb +5 -4
  202. package/dist/behaviors/exports/atoms/std-service-storage.orb +5 -4
  203. package/dist/behaviors/exports/atoms/std-service-stripe.orb +5 -4
  204. package/dist/behaviors/exports/atoms/std-service-twilio.orb +5 -4
  205. package/dist/behaviors/exports/atoms/std-service-youtube.orb +5 -4
  206. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +5 -4
  207. package/dist/behaviors/exports/atoms/std-sort.orb +5 -4
  208. package/dist/behaviors/exports/atoms/std-sprite.orb +5 -4
  209. package/dist/behaviors/exports/atoms/std-tabs.orb +5 -4
  210. package/dist/behaviors/exports/atoms/std-text-effects.orb +5 -4
  211. package/dist/behaviors/exports/atoms/std-theme.orb +5 -4
  212. package/dist/behaviors/exports/atoms/std-timer.orb +5 -4
  213. package/dist/behaviors/exports/atoms/std-undo.orb +5 -4
  214. package/dist/behaviors/exports/atoms/std-upload.orb +5 -4
  215. package/dist/behaviors/exports/atoms/std-validate-on-save.orb +5 -32
  216. package/dist/behaviors/exports/atoms/std-wizard.orb +5 -4
  217. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  218. package/dist/behaviors/exports/molecules/std-agent-learner.orb +608 -938
  219. package/dist/behaviors/exports/molecules/std-agent-planner.orb +613 -961
  220. package/dist/behaviors/exports/molecules/std-agent-rag.orb +586 -915
  221. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +915 -2846
  222. package/dist/behaviors/exports/molecules/std-builder-game.orb +5 -4
  223. package/dist/behaviors/exports/molecules/std-cart.orb +196 -307
  224. package/dist/behaviors/exports/molecules/std-classifier-game.orb +5 -4
  225. package/dist/behaviors/exports/molecules/std-debugger-game.orb +5 -4
  226. package/dist/behaviors/exports/molecules/std-detail.orb +309 -467
  227. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +5 -4
  228. package/dist/behaviors/exports/molecules/std-form-advanced.orb +5 -8
  229. package/dist/behaviors/exports/molecules/std-geospatial.orb +363 -539
  230. package/dist/behaviors/exports/molecules/std-inventory.orb +390 -720
  231. package/dist/behaviors/exports/molecules/std-list.orb +526 -1156
  232. package/dist/behaviors/exports/molecules/std-messaging.orb +295 -452
  233. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +5 -4
  234. package/dist/behaviors/exports/molecules/std-platformer-game.orb +5 -4
  235. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +5 -4
  236. package/dist/behaviors/exports/molecules/std-quiz.orb +5 -4
  237. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +5 -4
  238. package/dist/behaviors/exports/molecules/std-service-content-pipeline.orb +5 -4
  239. package/dist/behaviors/exports/molecules/std-service-custom-api-tester.orb +5 -42
  240. package/dist/behaviors/exports/molecules/std-service-devops-toolkit.orb +5 -4
  241. package/dist/behaviors/exports/molecules/std-service-notification-hub.orb +5 -4
  242. package/dist/behaviors/exports/molecules/std-service-payment-flow.orb +5 -4
  243. package/dist/behaviors/exports/molecules/std-simulator-game.orb +5 -4
  244. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +5 -4
  245. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +15 -143
  246. package/dist/behaviors/exports/organisms/std-agent-builder.orb +814 -1476
  247. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +785 -1567
  248. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +299 -502
  249. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +306 -493
  250. package/dist/behaviors/exports/organisms/std-api-gateway.orb +284 -626
  251. package/dist/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  252. package/dist/behaviors/exports/organisms/std-booking-system.orb +1422 -2160
  253. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +274 -617
  254. package/dist/behaviors/exports/organisms/std-cms.orb +1274 -1972
  255. package/dist/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  256. package/dist/behaviors/exports/organisms/std-crm.orb +999 -1775
  257. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +284 -638
  258. package/dist/behaviors/exports/organisms/std-ecommerce.orb +1653 -2398
  259. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +340 -684
  260. package/dist/behaviors/exports/organisms/std-healthcare.orb +984 -1838
  261. package/dist/behaviors/exports/organisms/std-helpdesk.orb +340 -744
  262. package/dist/behaviors/exports/organisms/std-hr-portal.orb +1401 -2151
  263. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +284 -626
  264. package/dist/behaviors/exports/organisms/std-lms.orb +284 -632
  265. package/dist/behaviors/exports/organisms/std-logic-training.orb +4 -4
  266. package/dist/behaviors/exports/organisms/std-platformer-app.orb +15 -98
  267. package/dist/behaviors/exports/organisms/std-project-manager.orb +970 -1774
  268. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  269. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +364 -714
  270. package/dist/behaviors/exports/organisms/std-rpg-game.orb +15 -102
  271. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +1589 -2361
  272. package/dist/behaviors/exports/organisms/std-service-research-assistant.orb +4 -15
  273. package/dist/behaviors/exports/organisms/std-social-feed.orb +62 -66
  274. package/dist/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  275. package/dist/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  276. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +274 -620
  277. package/dist/behaviors/exports-reader.js.map +1 -1
  278. package/dist/behaviors/functions/index.d.ts +2192 -0
  279. package/dist/behaviors/functions/index.js.map +1 -1
  280. package/dist/behaviors/index.js.map +1 -1
  281. package/dist/behaviors/query.js.map +1 -1
  282. package/dist/exports/atoms/std-agent-activity-log.orb +5 -45
  283. package/dist/exports/atoms/std-agent-chat-thread.orb +5 -55
  284. package/dist/exports/atoms/std-agent-classifier.orb +8 -8
  285. package/dist/exports/atoms/std-agent-completion.orb +8 -8
  286. package/dist/exports/atoms/std-agent-context-window.orb +5 -4
  287. package/dist/exports/atoms/std-agent-conversation.orb +5 -71
  288. package/dist/exports/atoms/std-agent-memory.orb +13 -127
  289. package/dist/exports/atoms/std-agent-provider.orb +8 -8
  290. package/dist/exports/atoms/std-agent-search.orb +6 -27
  291. package/dist/exports/atoms/std-agent-session.orb +11 -85
  292. package/dist/exports/atoms/std-agent-step-progress.orb +5 -4
  293. package/dist/exports/atoms/std-agent-token-gauge.orb +5 -4
  294. package/dist/exports/atoms/std-agent-tool-call.orb +8 -8
  295. package/dist/exports/atoms/std-async.orb +5 -8
  296. package/dist/exports/atoms/std-autoregressive.orb +4 -2
  297. package/dist/exports/atoms/std-browse.orb +5 -4
  298. package/dist/exports/atoms/std-cache-aside.orb +5 -8
  299. package/dist/exports/atoms/std-calendar.orb +5 -4
  300. package/dist/exports/atoms/std-circuit-breaker.orb +5 -4
  301. package/dist/exports/atoms/std-collision.orb +5 -4
  302. package/dist/exports/atoms/std-combat-log.orb +5 -4
  303. package/dist/exports/atoms/std-combat.orb +5 -4
  304. package/dist/exports/atoms/std-confirmation.orb +10 -4
  305. package/dist/exports/atoms/std-dialogue-box.orb +5 -4
  306. package/dist/exports/atoms/std-display.orb +5 -4
  307. package/dist/exports/atoms/std-drawer.orb +5 -4
  308. package/dist/exports/atoms/std-filter.orb +5 -4
  309. package/dist/exports/atoms/std-flip-card.orb +5 -4
  310. package/dist/exports/atoms/std-gallery.orb +5 -4
  311. package/dist/exports/atoms/std-game-audio.orb +5 -4
  312. package/dist/exports/atoms/std-game-canvas2d.orb +4 -2
  313. package/dist/exports/atoms/std-game-canvas3d.orb +4 -2
  314. package/dist/exports/atoms/std-game-hud.orb +5 -4
  315. package/dist/exports/atoms/std-game-menu.orb +5 -4
  316. package/dist/exports/atoms/std-game-over-screen.orb +5 -4
  317. package/dist/exports/atoms/std-gameflow.orb +5 -4
  318. package/dist/exports/atoms/std-input.orb +5 -4
  319. package/dist/exports/atoms/std-inventory-panel.orb +5 -8
  320. package/dist/exports/atoms/std-isometric-canvas.orb +5 -4
  321. package/dist/exports/atoms/std-loading.orb +5 -4
  322. package/dist/exports/atoms/std-modal.orb +89 -4
  323. package/dist/exports/atoms/std-movement.orb +5 -4
  324. package/dist/exports/atoms/std-notification.orb +5 -4
  325. package/dist/exports/atoms/std-overworld.orb +5 -4
  326. package/dist/exports/atoms/std-pagination.orb +5 -4
  327. package/dist/exports/atoms/std-physics2d.orb +5 -4
  328. package/dist/exports/atoms/std-platformer-canvas.orb +5 -4
  329. package/dist/exports/atoms/std-quest.orb +5 -8
  330. package/dist/exports/atoms/std-rate-limiter.orb +5 -4
  331. package/dist/exports/atoms/std-rating.orb +5 -4
  332. package/dist/exports/atoms/std-score-board.orb +5 -4
  333. package/dist/exports/atoms/std-score.orb +5 -4
  334. package/dist/exports/atoms/std-search.orb +5 -4
  335. package/dist/exports/atoms/std-selection.orb +5 -4
  336. package/dist/exports/atoms/std-service-custom-bearer.orb +5 -15
  337. package/dist/exports/atoms/std-service-custom-header.orb +5 -17
  338. package/dist/exports/atoms/std-service-custom-noauth.orb +5 -11
  339. package/dist/exports/atoms/std-service-custom-query.orb +5 -17
  340. package/dist/exports/atoms/std-service-email.orb +5 -4
  341. package/dist/exports/atoms/std-service-github.orb +5 -4
  342. package/dist/exports/atoms/std-service-llm.orb +5 -4
  343. package/dist/exports/atoms/std-service-oauth.orb +5 -4
  344. package/dist/exports/atoms/std-service-redis.orb +5 -4
  345. package/dist/exports/atoms/std-service-storage.orb +5 -4
  346. package/dist/exports/atoms/std-service-stripe.orb +5 -4
  347. package/dist/exports/atoms/std-service-twilio.orb +5 -4
  348. package/dist/exports/atoms/std-service-youtube.orb +5 -4
  349. package/dist/exports/atoms/std-simulation-canvas.orb +5 -4
  350. package/dist/exports/atoms/std-sort.orb +5 -4
  351. package/dist/exports/atoms/std-sprite.orb +5 -4
  352. package/dist/exports/atoms/std-tabs.orb +5 -4
  353. package/dist/exports/atoms/std-text-effects.orb +5 -4
  354. package/dist/exports/atoms/std-theme.orb +5 -4
  355. package/dist/exports/atoms/std-timer.orb +5 -4
  356. package/dist/exports/atoms/std-undo.orb +5 -4
  357. package/dist/exports/atoms/std-upload.orb +5 -4
  358. package/dist/exports/atoms/std-validate-on-save.orb +5 -32
  359. package/dist/exports/atoms/std-wizard.orb +5 -4
  360. package/dist/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  361. package/dist/exports/molecules/std-agent-learner.orb +608 -938
  362. package/dist/exports/molecules/std-agent-planner.orb +613 -961
  363. package/dist/exports/molecules/std-agent-rag.orb +586 -915
  364. package/dist/exports/molecules/std-agent-tool-loop.orb +915 -2846
  365. package/dist/exports/molecules/std-builder-game.orb +5 -4
  366. package/dist/exports/molecules/std-cart.orb +196 -307
  367. package/dist/exports/molecules/std-classifier-game.orb +5 -4
  368. package/dist/exports/molecules/std-debugger-game.orb +5 -4
  369. package/dist/exports/molecules/std-detail.orb +309 -467
  370. package/dist/exports/molecules/std-event-handler-game.orb +5 -4
  371. package/dist/exports/molecules/std-form-advanced.orb +5 -8
  372. package/dist/exports/molecules/std-geospatial.orb +363 -539
  373. package/dist/exports/molecules/std-inventory.orb +390 -720
  374. package/dist/exports/molecules/std-list.orb +526 -1156
  375. package/dist/exports/molecules/std-messaging.orb +295 -452
  376. package/dist/exports/molecules/std-negotiator-game.orb +5 -4
  377. package/dist/exports/molecules/std-platformer-game.orb +5 -4
  378. package/dist/exports/molecules/std-puzzle-game.orb +5 -4
  379. package/dist/exports/molecules/std-quiz.orb +5 -4
  380. package/dist/exports/molecules/std-sequencer-game.orb +5 -4
  381. package/dist/exports/molecules/std-service-content-pipeline.orb +5 -4
  382. package/dist/exports/molecules/std-service-custom-api-tester.orb +5 -42
  383. package/dist/exports/molecules/std-service-devops-toolkit.orb +5 -4
  384. package/dist/exports/molecules/std-service-notification-hub.orb +5 -4
  385. package/dist/exports/molecules/std-service-payment-flow.orb +5 -4
  386. package/dist/exports/molecules/std-simulator-game.orb +5 -4
  387. package/dist/exports/molecules/std-turn-based-battle.orb +5 -4
  388. package/dist/exports/organisms/std-agent-assistant.orb +15 -143
  389. package/dist/exports/organisms/std-agent-builder.orb +814 -1476
  390. package/dist/exports/organisms/std-agent-pipeline.orb +785 -1567
  391. package/dist/exports/organisms/std-agent-reviewer.orb +299 -502
  392. package/dist/exports/organisms/std-agent-tutor.orb +306 -493
  393. package/dist/exports/organisms/std-api-gateway.orb +284 -626
  394. package/dist/exports/organisms/std-arcade-game.orb +4 -4
  395. package/dist/exports/organisms/std-booking-system.orb +1422 -2160
  396. package/dist/exports/organisms/std-cicd-pipeline.orb +274 -617
  397. package/dist/exports/organisms/std-cms.orb +1274 -1972
  398. package/dist/exports/organisms/std-coding-academy.orb +4 -4
  399. package/dist/exports/organisms/std-crm.orb +999 -1775
  400. package/dist/exports/organisms/std-devops-dashboard.orb +284 -638
  401. package/dist/exports/organisms/std-ecommerce.orb +1653 -2398
  402. package/dist/exports/organisms/std-finance-tracker.orb +340 -684
  403. package/dist/exports/organisms/std-healthcare.orb +984 -1838
  404. package/dist/exports/organisms/std-helpdesk.orb +340 -744
  405. package/dist/exports/organisms/std-hr-portal.orb +1401 -2151
  406. package/dist/exports/organisms/std-iot-dashboard.orb +284 -626
  407. package/dist/exports/organisms/std-lms.orb +284 -632
  408. package/dist/exports/organisms/std-logic-training.orb +4 -4
  409. package/dist/exports/organisms/std-platformer-app.orb +15 -98
  410. package/dist/exports/organisms/std-project-manager.orb +970 -1774
  411. package/dist/exports/organisms/std-puzzle-app.orb +4 -4
  412. package/dist/exports/organisms/std-realtime-chat.orb +364 -714
  413. package/dist/exports/organisms/std-rpg-game.orb +15 -102
  414. package/dist/exports/organisms/std-service-marketplace.orb +1589 -2361
  415. package/dist/exports/organisms/std-service-research-assistant.orb +4 -15
  416. package/dist/exports/organisms/std-social-feed.orb +62 -66
  417. package/dist/exports/organisms/std-stem-lab.orb +4 -4
  418. package/dist/exports/organisms/std-strategy-game.orb +4 -4
  419. package/dist/exports/organisms/std-trading-dashboard.orb +274 -620
  420. package/dist/index.js.map +1 -1
  421. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  {
2
- "name": "EcommerceApp",
2
+ "name": "std-ecommerce",
3
3
  "version": "1.0.0",
4
+ "description": "E-commerce organism. Composes molecules via compose: - stdList(Product): product catalog with CRUD - stdCart(CartItem): shopping cart with add/remove - stdWizard(Checkout): checkout wizard - stdList(OrderRecord): order history",
4
5
  "orbitals": [
5
6
  {
6
7
  "name": "ProductOrbital",
@@ -51,11 +52,15 @@
51
52
  "listens": [
52
53
  {
53
54
  "event": "PRODUCT_CREATED",
54
- "triggers": "PRODUCT_CREATED"
55
+ "triggers": "INIT"
55
56
  },
56
57
  {
57
58
  "event": "PRODUCT_UPDATED",
58
- "triggers": "PRODUCT_UPDATED"
59
+ "triggers": "INIT"
60
+ },
61
+ {
62
+ "event": "PRODUCT_DELETED",
63
+ "triggers": "INIT"
59
64
  }
60
65
  ],
61
66
  "stateMachine": {
@@ -63,9 +68,6 @@
63
68
  {
64
69
  "name": "browsing",
65
70
  "isInitial": true
66
- },
67
- {
68
- "name": "deleting"
69
71
  }
70
72
  ],
71
73
  "events": [
@@ -121,40 +123,6 @@
121
123
  "type": "object"
122
124
  }
123
125
  ]
124
- },
125
- {
126
- "key": "PRODUCT_CREATED",
127
- "name": "PRODUCT_CREATED",
128
- "payload": [
129
- {
130
- "name": "data",
131
- "type": "object",
132
- "required": true
133
- }
134
- ]
135
- },
136
- {
137
- "key": "PRODUCT_UPDATED",
138
- "name": "PRODUCT_UPDATED",
139
- "payload": [
140
- {
141
- "name": "data",
142
- "type": "object",
143
- "required": true
144
- }
145
- ]
146
- },
147
- {
148
- "key": "CONFIRM_DELETE",
149
- "name": "Confirm Delete"
150
- },
151
- {
152
- "key": "CANCEL",
153
- "name": "Cancel"
154
- },
155
- {
156
- "key": "CLOSE",
157
- "name": "Close"
158
126
  }
159
127
  ],
160
128
  "transitions": [
@@ -307,22 +275,75 @@
307
275
  }
308
276
  ]
309
277
  ]
278
+ }
279
+ ]
280
+ },
281
+ "emits": [
282
+ {
283
+ "event": "ADD_TO_CART",
284
+ "payload": [
285
+ {
286
+ "name": "id",
287
+ "type": "string",
288
+ "required": true
289
+ }
290
+ ],
291
+ "scope": "external"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "name": "ProductCreate",
297
+ "linkedEntity": "Product",
298
+ "category": "interaction",
299
+ "emits": [
300
+ {
301
+ "event": "SAVE"
302
+ },
303
+ {
304
+ "event": "PRODUCT_CREATED"
305
+ }
306
+ ],
307
+ "stateMachine": {
308
+ "states": [
309
+ {
310
+ "name": "closed",
311
+ "isInitial": true
310
312
  },
311
313
  {
312
- "from": "browsing",
313
- "to": "browsing",
314
- "event": "PRODUCT_CREATED",
315
- "effects": [
316
- [
317
- "ref",
318
- "Product"
319
- ]
320
- ]
314
+ "name": "open"
315
+ }
316
+ ],
317
+ "events": [
318
+ {
319
+ "key": "INIT",
320
+ "name": "Initialize"
321
321
  },
322
322
  {
323
- "from": "browsing",
324
- "to": "browsing",
325
- "event": "PRODUCT_UPDATED",
323
+ "key": "CREATE",
324
+ "name": "Open"
325
+ },
326
+ {
327
+ "key": "CLOSE",
328
+ "name": "Close"
329
+ },
330
+ {
331
+ "key": "SAVE",
332
+ "name": "Save",
333
+ "payload": [
334
+ {
335
+ "name": "data",
336
+ "type": "object",
337
+ "required": true
338
+ }
339
+ ]
340
+ }
341
+ ],
342
+ "transitions": [
343
+ {
344
+ "from": "closed",
345
+ "to": "closed",
346
+ "event": "INIT",
326
347
  "effects": [
327
348
  [
328
349
  "ref",
@@ -331,16 +352,13 @@
331
352
  ]
332
353
  },
333
354
  {
334
- "from": "browsing",
335
- "to": "deleting",
336
- "event": "DELETE",
355
+ "from": "closed",
356
+ "to": "open",
357
+ "event": "CREATE",
337
358
  "effects": [
338
359
  [
339
360
  "fetch",
340
- "Product",
341
- {
342
- "id": "@payload.id"
343
- }
361
+ "Product"
344
362
  ],
345
363
  [
346
364
  "render-ui",
@@ -357,12 +375,12 @@
357
375
  "children": [
358
376
  {
359
377
  "type": "icon",
360
- "name": "trash-2",
378
+ "name": "plus-circle",
361
379
  "size": "md"
362
380
  },
363
381
  {
364
382
  "type": "typography",
365
- "content": "Delete Product",
383
+ "content": "Create Product",
366
384
  "variant": "h3"
367
385
  }
368
386
  ]
@@ -371,34 +389,18 @@
371
389
  "type": "divider"
372
390
  },
373
391
  {
374
- "type": "typography",
375
- "content": "@entity.name",
376
- "variant": "h4"
377
- },
378
- {
379
- "type": "typography",
380
- "content": "This action cannot be undone.",
381
- "variant": "body"
382
- },
383
- {
384
- "type": "stack",
385
- "direction": "horizontal",
386
- "gap": "sm",
387
- "justify": "end",
388
- "children": [
389
- {
390
- "type": "button",
391
- "label": "Cancel",
392
- "event": "CANCEL",
393
- "variant": "ghost"
394
- },
395
- {
396
- "type": "button",
397
- "label": "Delete",
398
- "event": "CONFIRM_DELETE",
399
- "variant": "danger",
400
- "icon": "trash"
401
- }
392
+ "type": "form-section",
393
+ "entity": "Product",
394
+ "mode": "create",
395
+ "submitEvent": "SAVE",
396
+ "cancelEvent": "CLOSE",
397
+ "fields": [
398
+ "name",
399
+ "description",
400
+ "price",
401
+ "category",
402
+ "sku",
403
+ "inStock"
402
404
  ]
403
405
  }
404
406
  ]
@@ -407,15 +409,32 @@
407
409
  ]
408
410
  },
409
411
  {
410
- "from": "deleting",
411
- "to": "browsing",
412
- "event": "CONFIRM_DELETE",
412
+ "from": "open",
413
+ "to": "closed",
414
+ "event": "CLOSE",
415
+ "effects": [
416
+ [
417
+ "render-ui",
418
+ "modal",
419
+ null
420
+ ],
421
+ [
422
+ "notify",
423
+ "Cancelled",
424
+ "info"
425
+ ]
426
+ ]
427
+ },
428
+ {
429
+ "from": "open",
430
+ "to": "closed",
431
+ "event": "SAVE",
413
432
  "effects": [
414
433
  [
415
434
  "persist",
416
- "delete",
435
+ "create",
417
436
  "Product",
418
- "@entity.id"
437
+ "@payload.data"
419
438
  ],
420
439
  [
421
440
  "render-ui",
@@ -423,154 +442,145 @@
423
442
  null
424
443
  ],
425
444
  [
426
- "render-ui",
427
- "main",
428
- {
429
- "type": "dashboard-layout",
430
- "appName": "EcommerceApp",
431
- "navItems": [
432
- {
433
- "label": "Products",
434
- "href": "/products",
435
- "icon": "package"
436
- },
437
- {
438
- "label": "Cart",
439
- "href": "/cart",
440
- "icon": "shopping-cart"
441
- },
442
- {
443
- "label": "Checkout",
444
- "href": "/checkout",
445
- "icon": "credit-card"
446
- },
447
- {
448
- "label": "Orders",
449
- "href": "/orders",
450
- "icon": "clipboard-list"
451
- }
452
- ],
453
- "children": [
454
- {
455
- "type": "stack",
456
- "direction": "vertical",
457
- "gap": "lg",
458
- "className": "max-w-5xl mx-auto w-full",
459
- "children": [
460
- {
461
- "type": "stack",
462
- "direction": "horizontal",
463
- "gap": "md",
464
- "justify": "space-between",
465
- "align": "center",
466
- "children": [
467
- {
468
- "type": "stack",
469
- "direction": "horizontal",
470
- "gap": "sm",
471
- "align": "center",
472
- "children": [
473
- {
474
- "type": "icon",
475
- "name": "package",
476
- "size": "lg"
477
- },
478
- {
479
- "type": "typography",
480
- "content": "Products",
481
- "variant": "h2"
482
- }
483
- ]
484
- },
485
- {
486
- "type": "stack",
487
- "direction": "horizontal",
488
- "gap": "sm",
489
- "children": [
490
- {
491
- "type": "button",
492
- "label": "Create Product",
493
- "event": "CREATE",
494
- "variant": "primary",
495
- "icon": "plus"
496
- }
497
- ]
498
- }
499
- ]
500
- },
501
- {
502
- "type": "divider"
503
- },
445
+ "emit",
446
+ "PRODUCT_CREATED"
447
+ ]
448
+ ]
449
+ }
450
+ ]
451
+ }
452
+ },
453
+ {
454
+ "name": "ProductEdit",
455
+ "linkedEntity": "Product",
456
+ "category": "interaction",
457
+ "emits": [
458
+ {
459
+ "event": "SAVE"
460
+ },
461
+ {
462
+ "event": "PRODUCT_UPDATED"
463
+ }
464
+ ],
465
+ "stateMachine": {
466
+ "states": [
467
+ {
468
+ "name": "closed",
469
+ "isInitial": true
470
+ },
471
+ {
472
+ "name": "open"
473
+ }
474
+ ],
475
+ "events": [
476
+ {
477
+ "key": "INIT",
478
+ "name": "Initialize"
479
+ },
480
+ {
481
+ "key": "EDIT",
482
+ "name": "Open",
483
+ "payload": [
484
+ {
485
+ "name": "id",
486
+ "type": "string",
487
+ "required": true
488
+ }
489
+ ]
490
+ },
491
+ {
492
+ "key": "CLOSE",
493
+ "name": "Close"
494
+ },
495
+ {
496
+ "key": "SAVE",
497
+ "name": "Save",
498
+ "payload": [
499
+ {
500
+ "name": "data",
501
+ "type": "object",
502
+ "required": true
503
+ }
504
+ ]
505
+ }
506
+ ],
507
+ "transitions": [
508
+ {
509
+ "from": "closed",
510
+ "to": "closed",
511
+ "event": "INIT",
512
+ "effects": [
513
+ [
514
+ "ref",
515
+ "Product"
516
+ ]
517
+ ]
518
+ },
519
+ {
520
+ "from": "closed",
521
+ "to": "open",
522
+ "event": "EDIT",
523
+ "effects": [
524
+ [
525
+ "fetch",
526
+ "Product",
527
+ {
528
+ "id": "@payload.id"
529
+ }
530
+ ],
531
+ [
532
+ "render-ui",
533
+ "modal",
534
+ {
535
+ "type": "stack",
536
+ "direction": "vertical",
537
+ "gap": "md",
538
+ "children": [
539
+ {
540
+ "type": "stack",
541
+ "direction": "horizontal",
542
+ "gap": "sm",
543
+ "children": [
504
544
  {
505
- "type": "data-grid",
506
- "entity": "Product",
507
- "emptyIcon": "inbox",
508
- "emptyTitle": "No products yet",
509
- "emptyDescription": "Add products to build your catalog.",
510
- "itemActions": [
511
- {
512
- "label": "View",
513
- "event": "VIEW",
514
- "variant": "ghost",
515
- "size": "sm"
516
- },
517
- {
518
- "label": "Edit",
519
- "event": "EDIT",
520
- "variant": "ghost",
521
- "size": "sm"
522
- },
523
- {
524
- "label": "Delete",
525
- "event": "DELETE",
526
- "variant": "danger",
527
- "size": "sm"
528
- }
529
- ],
530
- "columns": [
531
- {
532
- "name": "name",
533
- "variant": "h3",
534
- "icon": "package"
535
- },
536
- {
537
- "name": "category",
538
- "variant": "badge"
539
- },
540
- {
541
- "name": "price",
542
- "variant": "h4",
543
- "format": "currency"
544
- },
545
- {
546
- "name": "sku",
547
- "variant": "caption"
548
- },
549
- {
550
- "name": "inStock",
551
- "label": "In Stock",
552
- "variant": "body",
553
- "format": "boolean"
554
- }
555
- ],
556
- "cols": 3,
557
- "gap": "md"
545
+ "type": "icon",
546
+ "name": "edit",
547
+ "size": "md"
548
+ },
549
+ {
550
+ "type": "typography",
551
+ "content": "Edit Product",
552
+ "variant": "h3"
558
553
  }
559
554
  ]
555
+ },
556
+ {
557
+ "type": "divider"
558
+ },
559
+ {
560
+ "type": "form-section",
561
+ "entity": "Product",
562
+ "mode": "edit",
563
+ "submitEvent": "SAVE",
564
+ "cancelEvent": "CLOSE",
565
+ "fields": [
566
+ "name",
567
+ "description",
568
+ "price",
569
+ "category",
570
+ "sku",
571
+ "inStock"
572
+ ],
573
+ "entityId": "@entity.id"
560
574
  }
561
575
  ]
562
576
  }
563
- ],
564
- [
565
- "notify",
566
- "Product deleted successfully"
567
577
  ]
568
578
  ]
569
579
  },
570
580
  {
571
- "from": "deleting",
572
- "to": "browsing",
573
- "event": "CANCEL",
581
+ "from": "open",
582
+ "to": "closed",
583
+ "event": "CLOSE",
574
584
  "effects": [
575
585
  [
576
586
  "render-ui",
@@ -578,328 +588,44 @@
578
588
  null
579
589
  ],
580
590
  [
581
- "fetch",
582
- "Product"
591
+ "notify",
592
+ "Cancelled",
593
+ "info"
594
+ ]
595
+ ]
596
+ },
597
+ {
598
+ "from": "open",
599
+ "to": "closed",
600
+ "event": "SAVE",
601
+ "effects": [
602
+ [
603
+ "persist",
604
+ "update",
605
+ "Product",
606
+ "@payload.data"
583
607
  ],
584
- [
585
- "render-ui",
586
- "main",
587
- {
588
- "type": "dashboard-layout",
589
- "appName": "EcommerceApp",
590
- "navItems": [
591
- {
592
- "label": "Products",
593
- "href": "/products",
594
- "icon": "package"
595
- },
596
- {
597
- "label": "Cart",
598
- "href": "/cart",
599
- "icon": "shopping-cart"
600
- },
601
- {
602
- "label": "Checkout",
603
- "href": "/checkout",
604
- "icon": "credit-card"
605
- },
606
- {
607
- "label": "Orders",
608
- "href": "/orders",
609
- "icon": "clipboard-list"
610
- }
611
- ],
612
- "children": [
613
- {
614
- "type": "stack",
615
- "direction": "vertical",
616
- "gap": "lg",
617
- "className": "max-w-5xl mx-auto w-full",
618
- "children": [
619
- {
620
- "type": "stack",
621
- "direction": "horizontal",
622
- "gap": "md",
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": "lg"
636
- },
637
- {
638
- "type": "typography",
639
- "content": "Products",
640
- "variant": "h2"
641
- }
642
- ]
643
- },
644
- {
645
- "type": "stack",
646
- "direction": "horizontal",
647
- "gap": "sm",
648
- "children": [
649
- {
650
- "type": "button",
651
- "label": "Create Product",
652
- "event": "CREATE",
653
- "variant": "primary",
654
- "icon": "plus"
655
- }
656
- ]
657
- }
658
- ]
659
- },
660
- {
661
- "type": "divider"
662
- },
663
- {
664
- "type": "data-grid",
665
- "entity": "Product",
666
- "emptyIcon": "inbox",
667
- "emptyTitle": "No products yet",
668
- "emptyDescription": "Add products to build your catalog.",
669
- "itemActions": [
670
- {
671
- "label": "View",
672
- "event": "VIEW",
673
- "variant": "ghost",
674
- "size": "sm"
675
- },
676
- {
677
- "label": "Edit",
678
- "event": "EDIT",
679
- "variant": "ghost",
680
- "size": "sm"
681
- },
682
- {
683
- "label": "Delete",
684
- "event": "DELETE",
685
- "variant": "danger",
686
- "size": "sm"
687
- }
688
- ],
689
- "columns": [
690
- {
691
- "name": "name",
692
- "variant": "h3",
693
- "icon": "package"
694
- },
695
- {
696
- "name": "category",
697
- "variant": "badge"
698
- },
699
- {
700
- "name": "price",
701
- "variant": "h4",
702
- "format": "currency"
703
- },
704
- {
705
- "name": "sku",
706
- "variant": "caption"
707
- },
708
- {
709
- "name": "inStock",
710
- "label": "In Stock",
711
- "variant": "body",
712
- "format": "boolean"
713
- }
714
- ],
715
- "cols": 3,
716
- "gap": "md"
717
- }
718
- ]
719
- }
720
- ]
721
- }
722
- ]
723
- ]
724
- },
725
- {
726
- "from": "deleting",
727
- "to": "browsing",
728
- "event": "CLOSE",
729
- "effects": [
730
608
  [
731
609
  "render-ui",
732
610
  "modal",
733
611
  null
734
612
  ],
735
613
  [
736
- "fetch",
737
- "Product"
738
- ],
739
- [
740
- "render-ui",
741
- "main",
742
- {
743
- "type": "dashboard-layout",
744
- "appName": "EcommerceApp",
745
- "navItems": [
746
- {
747
- "label": "Products",
748
- "href": "/products",
749
- "icon": "package"
750
- },
751
- {
752
- "label": "Cart",
753
- "href": "/cart",
754
- "icon": "shopping-cart"
755
- },
756
- {
757
- "label": "Checkout",
758
- "href": "/checkout",
759
- "icon": "credit-card"
760
- },
761
- {
762
- "label": "Orders",
763
- "href": "/orders",
764
- "icon": "clipboard-list"
765
- }
766
- ],
767
- "children": [
768
- {
769
- "type": "stack",
770
- "direction": "vertical",
771
- "gap": "lg",
772
- "className": "max-w-5xl mx-auto w-full",
773
- "children": [
774
- {
775
- "type": "stack",
776
- "direction": "horizontal",
777
- "gap": "md",
778
- "justify": "space-between",
779
- "align": "center",
780
- "children": [
781
- {
782
- "type": "stack",
783
- "direction": "horizontal",
784
- "gap": "sm",
785
- "align": "center",
786
- "children": [
787
- {
788
- "type": "icon",
789
- "name": "package",
790
- "size": "lg"
791
- },
792
- {
793
- "type": "typography",
794
- "content": "Products",
795
- "variant": "h2"
796
- }
797
- ]
798
- },
799
- {
800
- "type": "stack",
801
- "direction": "horizontal",
802
- "gap": "sm",
803
- "children": [
804
- {
805
- "type": "button",
806
- "label": "Create Product",
807
- "event": "CREATE",
808
- "variant": "primary",
809
- "icon": "plus"
810
- }
811
- ]
812
- }
813
- ]
814
- },
815
- {
816
- "type": "divider"
817
- },
818
- {
819
- "type": "data-grid",
820
- "entity": "Product",
821
- "emptyIcon": "inbox",
822
- "emptyTitle": "No products yet",
823
- "emptyDescription": "Add products to build your catalog.",
824
- "itemActions": [
825
- {
826
- "label": "View",
827
- "event": "VIEW",
828
- "variant": "ghost",
829
- "size": "sm"
830
- },
831
- {
832
- "label": "Edit",
833
- "event": "EDIT",
834
- "variant": "ghost",
835
- "size": "sm"
836
- },
837
- {
838
- "label": "Delete",
839
- "event": "DELETE",
840
- "variant": "danger",
841
- "size": "sm"
842
- }
843
- ],
844
- "columns": [
845
- {
846
- "name": "name",
847
- "variant": "h3",
848
- "icon": "package"
849
- },
850
- {
851
- "name": "category",
852
- "variant": "badge"
853
- },
854
- {
855
- "name": "price",
856
- "variant": "h4",
857
- "format": "currency"
858
- },
859
- {
860
- "name": "sku",
861
- "variant": "caption"
862
- },
863
- {
864
- "name": "inStock",
865
- "label": "In Stock",
866
- "variant": "body",
867
- "format": "boolean"
868
- }
869
- ],
870
- "cols": 3,
871
- "gap": "md"
872
- }
873
- ]
874
- }
875
- ]
876
- }
614
+ "emit",
615
+ "PRODUCT_UPDATED"
877
616
  ]
878
617
  ]
879
618
  }
880
619
  ]
881
- },
882
- "emits": [
883
- {
884
- "event": "ADD_TO_CART",
885
- "payload": [
886
- {
887
- "name": "id",
888
- "type": "string",
889
- "required": true
890
- }
891
- ],
892
- "scope": "external"
893
- }
894
- ]
620
+ }
895
621
  },
896
622
  {
897
- "name": "ProductCreate",
623
+ "name": "ProductView",
898
624
  "linkedEntity": "Product",
899
625
  "category": "interaction",
900
626
  "emits": [
901
627
  {
902
- "event": "PRODUCT_CREATED"
628
+ "event": "SAVE"
903
629
  }
904
630
  ],
905
631
  "stateMachine": {
@@ -918,8 +644,15 @@
918
644
  "name": "Initialize"
919
645
  },
920
646
  {
921
- "key": "CREATE",
922
- "name": "Open"
647
+ "key": "VIEW",
648
+ "name": "Open",
649
+ "payload": [
650
+ {
651
+ "name": "id",
652
+ "type": "string",
653
+ "required": true
654
+ }
655
+ ]
923
656
  },
924
657
  {
925
658
  "key": "CLOSE",
@@ -952,11 +685,14 @@
952
685
  {
953
686
  "from": "closed",
954
687
  "to": "open",
955
- "event": "CREATE",
688
+ "event": "VIEW",
956
689
  "effects": [
957
690
  [
958
691
  "fetch",
959
- "Product"
692
+ "Product",
693
+ {
694
+ "id": "@payload.id"
695
+ }
960
696
  ],
961
697
  [
962
698
  "render-ui",
@@ -970,16 +706,17 @@
970
706
  "type": "stack",
971
707
  "direction": "horizontal",
972
708
  "gap": "sm",
709
+ "align": "center",
973
710
  "children": [
974
711
  {
975
712
  "type": "icon",
976
- "name": "plus-circle",
713
+ "name": "eye",
977
714
  "size": "md"
978
715
  },
979
716
  {
980
717
  "type": "typography",
981
- "content": "Create Product",
982
- "variant": "h3"
718
+ "variant": "h3",
719
+ "content": "@entity.name"
983
720
  }
984
721
  ]
985
722
  },
@@ -987,18 +724,129 @@
987
724
  "type": "divider"
988
725
  },
989
726
  {
990
- "type": "form-section",
991
- "entity": "Product",
992
- "mode": "create",
993
- "submitEvent": "SAVE",
994
- "cancelEvent": "CLOSE",
995
- "fields": [
996
- "name",
997
- "description",
998
- "price",
999
- "category",
1000
- "sku",
1001
- "inStock"
727
+ "type": "stack",
728
+ "direction": "horizontal",
729
+ "gap": "md",
730
+ "children": [
731
+ {
732
+ "type": "typography",
733
+ "variant": "caption",
734
+ "content": "Name"
735
+ },
736
+ {
737
+ "type": "typography",
738
+ "variant": "body",
739
+ "content": "@entity.name"
740
+ }
741
+ ]
742
+ },
743
+ {
744
+ "type": "stack",
745
+ "direction": "horizontal",
746
+ "gap": "md",
747
+ "children": [
748
+ {
749
+ "type": "typography",
750
+ "variant": "caption",
751
+ "content": "Description"
752
+ },
753
+ {
754
+ "type": "typography",
755
+ "variant": "body",
756
+ "content": "@entity.description"
757
+ }
758
+ ]
759
+ },
760
+ {
761
+ "type": "stack",
762
+ "direction": "horizontal",
763
+ "gap": "md",
764
+ "children": [
765
+ {
766
+ "type": "typography",
767
+ "variant": "caption",
768
+ "content": "Price"
769
+ },
770
+ {
771
+ "type": "typography",
772
+ "variant": "body",
773
+ "content": "@entity.price"
774
+ }
775
+ ]
776
+ },
777
+ {
778
+ "type": "stack",
779
+ "direction": "horizontal",
780
+ "gap": "md",
781
+ "children": [
782
+ {
783
+ "type": "typography",
784
+ "variant": "caption",
785
+ "content": "Category"
786
+ },
787
+ {
788
+ "type": "typography",
789
+ "variant": "body",
790
+ "content": "@entity.category"
791
+ }
792
+ ]
793
+ },
794
+ {
795
+ "type": "stack",
796
+ "direction": "horizontal",
797
+ "gap": "md",
798
+ "children": [
799
+ {
800
+ "type": "typography",
801
+ "variant": "caption",
802
+ "content": "Sku"
803
+ },
804
+ {
805
+ "type": "typography",
806
+ "variant": "body",
807
+ "content": "@entity.sku"
808
+ }
809
+ ]
810
+ },
811
+ {
812
+ "type": "stack",
813
+ "direction": "horizontal",
814
+ "gap": "md",
815
+ "children": [
816
+ {
817
+ "type": "typography",
818
+ "variant": "caption",
819
+ "content": "In Stock"
820
+ },
821
+ {
822
+ "type": "typography",
823
+ "variant": "body",
824
+ "content": "@entity.inStock"
825
+ }
826
+ ]
827
+ },
828
+ {
829
+ "type": "divider"
830
+ },
831
+ {
832
+ "type": "stack",
833
+ "direction": "horizontal",
834
+ "gap": "sm",
835
+ "justify": "end",
836
+ "children": [
837
+ {
838
+ "type": "button",
839
+ "label": "Edit",
840
+ "event": "EDIT",
841
+ "variant": "primary",
842
+ "icon": "edit"
843
+ },
844
+ {
845
+ "type": "button",
846
+ "label": "Close",
847
+ "event": "CLOSE",
848
+ "variant": "ghost"
849
+ }
1002
850
  ]
1003
851
  }
1004
852
  ]
@@ -1028,24 +876,10 @@
1028
876
  "to": "closed",
1029
877
  "event": "SAVE",
1030
878
  "effects": [
1031
- [
1032
- "persist",
1033
- "create",
1034
- "Product",
1035
- "@payload.data"
1036
- ],
1037
879
  [
1038
880
  "render-ui",
1039
881
  "modal",
1040
882
  null
1041
- ],
1042
- [
1043
- "emit",
1044
- "PRODUCT_CREATED"
1045
- ],
1046
- [
1047
- "notify",
1048
- "Product created successfully"
1049
883
  ]
1050
884
  ]
1051
885
  }
@@ -1053,22 +887,25 @@
1053
887
  }
1054
888
  },
1055
889
  {
1056
- "name": "ProductEdit",
890
+ "name": "ProductDelete",
1057
891
  "linkedEntity": "Product",
1058
892
  "category": "interaction",
1059
893
  "emits": [
1060
894
  {
1061
- "event": "PRODUCT_UPDATED"
895
+ "event": "CONFIRM_DELETE"
896
+ },
897
+ {
898
+ "event": "PRODUCT_DELETED"
1062
899
  }
1063
900
  ],
1064
901
  "stateMachine": {
1065
902
  "states": [
1066
903
  {
1067
- "name": "closed",
904
+ "name": "idle",
1068
905
  "isInitial": true
1069
906
  },
1070
907
  {
1071
- "name": "open"
908
+ "name": "confirming"
1072
909
  }
1073
910
  ],
1074
911
  "events": [
@@ -1077,8 +914,8 @@
1077
914
  "name": "Initialize"
1078
915
  },
1079
916
  {
1080
- "key": "EDIT",
1081
- "name": "Open",
917
+ "key": "DELETE",
918
+ "name": "Request Confirmation",
1082
919
  "payload": [
1083
920
  {
1084
921
  "name": "id",
@@ -1088,25 +925,22 @@
1088
925
  ]
1089
926
  },
1090
927
  {
1091
- "key": "CLOSE",
1092
- "name": "Close"
928
+ "key": "CONFIRM_DELETE",
929
+ "name": "Confirm"
1093
930
  },
1094
931
  {
1095
- "key": "SAVE",
1096
- "name": "Save",
1097
- "payload": [
1098
- {
1099
- "name": "data",
1100
- "type": "object",
1101
- "required": true
1102
- }
1103
- ]
932
+ "key": "CANCEL",
933
+ "name": "Cancel"
934
+ },
935
+ {
936
+ "key": "CLOSE",
937
+ "name": "Close"
1104
938
  }
1105
939
  ],
1106
940
  "transitions": [
1107
941
  {
1108
- "from": "closed",
1109
- "to": "closed",
942
+ "from": "idle",
943
+ "to": "idle",
1110
944
  "event": "INIT",
1111
945
  "effects": [
1112
946
  [
@@ -1116,10 +950,15 @@
1116
950
  ]
1117
951
  },
1118
952
  {
1119
- "from": "closed",
1120
- "to": "open",
1121
- "event": "EDIT",
953
+ "from": "idle",
954
+ "to": "confirming",
955
+ "event": "DELETE",
1122
956
  "effects": [
957
+ [
958
+ "set",
959
+ "@entity.pendingId",
960
+ "@payload.id"
961
+ ],
1123
962
  [
1124
963
  "fetch",
1125
964
  "Product",
@@ -1139,15 +978,16 @@
1139
978
  "type": "stack",
1140
979
  "direction": "horizontal",
1141
980
  "gap": "sm",
981
+ "align": "center",
1142
982
  "children": [
1143
983
  {
1144
984
  "type": "icon",
1145
- "name": "edit",
985
+ "name": "alert-triangle",
1146
986
  "size": "md"
1147
987
  },
1148
988
  {
1149
989
  "type": "typography",
1150
- "content": "Edit Product",
990
+ "content": "Delete Product",
1151
991
  "variant": "h3"
1152
992
  }
1153
993
  ]
@@ -1156,84 +996,175 @@
1156
996
  "type": "divider"
1157
997
  },
1158
998
  {
1159
- "type": "form-section",
1160
- "entity": "Product",
1161
- "mode": "edit",
1162
- "submitEvent": "SAVE",
1163
- "cancelEvent": "CLOSE",
1164
- "fields": [
1165
- "name",
1166
- "description",
1167
- "price",
1168
- "category",
1169
- "sku",
1170
- "inStock"
1171
- ],
1172
- "entityId": "@entity.id"
1173
- }
1174
- ]
1175
- }
1176
- ]
1177
- ]
1178
- },
1179
- {
1180
- "from": "open",
1181
- "to": "closed",
1182
- "event": "CLOSE",
1183
- "effects": [
1184
- [
1185
- "render-ui",
1186
- "modal",
1187
- null
1188
- ],
1189
- [
1190
- "notify",
1191
- "Cancelled",
1192
- "info"
999
+ "type": "alert",
1000
+ "variant": "danger",
1001
+ "message": "This action cannot be undone."
1002
+ },
1003
+ {
1004
+ "type": "stack",
1005
+ "direction": "horizontal",
1006
+ "gap": "sm",
1007
+ "justify": "end",
1008
+ "children": [
1009
+ {
1010
+ "type": "button",
1011
+ "label": "Cancel",
1012
+ "event": "CANCEL",
1013
+ "variant": "ghost"
1014
+ },
1015
+ {
1016
+ "type": "button",
1017
+ "label": "Delete",
1018
+ "event": "CONFIRM_DELETE",
1019
+ "variant": "danger",
1020
+ "icon": "check"
1021
+ }
1022
+ ]
1023
+ }
1024
+ ]
1025
+ }
1193
1026
  ]
1194
1027
  ]
1195
1028
  },
1196
1029
  {
1197
- "from": "open",
1198
- "to": "closed",
1199
- "event": "SAVE",
1030
+ "from": "confirming",
1031
+ "to": "idle",
1032
+ "event": "CONFIRM_DELETE",
1200
1033
  "effects": [
1201
1034
  [
1202
1035
  "persist",
1203
- "update",
1036
+ "delete",
1204
1037
  "Product",
1205
- "@payload.data"
1038
+ "@entity.pendingId"
1206
1039
  ],
1207
1040
  [
1208
1041
  "render-ui",
1209
1042
  "modal",
1210
1043
  null
1211
1044
  ],
1045
+ [
1046
+ "ref",
1047
+ "Product"
1048
+ ],
1212
1049
  [
1213
1050
  "emit",
1214
- "PRODUCT_UPDATED"
1051
+ "PRODUCT_DELETED"
1052
+ ]
1053
+ ]
1054
+ },
1055
+ {
1056
+ "from": "confirming",
1057
+ "to": "idle",
1058
+ "event": "CANCEL",
1059
+ "effects": [
1060
+ [
1061
+ "render-ui",
1062
+ "modal",
1063
+ null
1215
1064
  ],
1216
1065
  [
1217
- "notify",
1218
- "Product updated successfully"
1066
+ "ref",
1067
+ "Product"
1068
+ ]
1069
+ ]
1070
+ },
1071
+ {
1072
+ "from": "confirming",
1073
+ "to": "idle",
1074
+ "event": "CLOSE",
1075
+ "effects": [
1076
+ [
1077
+ "render-ui",
1078
+ "modal",
1079
+ null
1080
+ ],
1081
+ [
1082
+ "ref",
1083
+ "Product"
1219
1084
  ]
1220
1085
  ]
1221
1086
  }
1222
1087
  ]
1223
1088
  }
1224
- },
1089
+ }
1090
+ ],
1091
+ "pages": [
1225
1092
  {
1226
- "name": "ProductView",
1227
- "linkedEntity": "Product",
1093
+ "name": "ProductsPage",
1094
+ "path": "/products",
1095
+ "isInitial": true,
1096
+ "traits": [
1097
+ {
1098
+ "ref": "ProductBrowse"
1099
+ },
1100
+ {
1101
+ "ref": "ProductCreate"
1102
+ },
1103
+ {
1104
+ "ref": "ProductEdit"
1105
+ },
1106
+ {
1107
+ "ref": "ProductView"
1108
+ },
1109
+ {
1110
+ "ref": "ProductDelete"
1111
+ }
1112
+ ]
1113
+ }
1114
+ ]
1115
+ },
1116
+ {
1117
+ "name": "CartItemOrbital",
1118
+ "entity": {
1119
+ "name": "CartItem",
1120
+ "persistence": "persistent",
1121
+ "collection": "cartitems",
1122
+ "fields": [
1123
+ {
1124
+ "name": "id",
1125
+ "type": "string",
1126
+ "required": true
1127
+ },
1128
+ {
1129
+ "name": "productName",
1130
+ "type": "string",
1131
+ "required": true
1132
+ },
1133
+ {
1134
+ "name": "quantity",
1135
+ "type": "number",
1136
+ "required": true,
1137
+ "default": 1
1138
+ },
1139
+ {
1140
+ "name": "unitPrice",
1141
+ "type": "number",
1142
+ "required": true
1143
+ },
1144
+ {
1145
+ "name": "totalPrice",
1146
+ "type": "number"
1147
+ },
1148
+ {
1149
+ "name": "pendingId",
1150
+ "type": "string",
1151
+ "default": ""
1152
+ }
1153
+ ]
1154
+ },
1155
+ "traits": [
1156
+ {
1157
+ "name": "CartItemCartBrowse",
1158
+ "linkedEntity": "CartItem",
1228
1159
  "category": "interaction",
1229
1160
  "stateMachine": {
1230
1161
  "states": [
1231
1162
  {
1232
- "name": "closed",
1163
+ "name": "browsing",
1233
1164
  "isInitial": true
1234
1165
  },
1235
1166
  {
1236
- "name": "open"
1167
+ "name": "checkout"
1237
1168
  }
1238
1169
  ],
1239
1170
  "events": [
@@ -1242,8 +1173,12 @@
1242
1173
  "name": "Initialize"
1243
1174
  },
1244
1175
  {
1245
- "key": "VIEW",
1246
- "name": "Open",
1176
+ "key": "ADD_ITEM",
1177
+ "name": "Add Item"
1178
+ },
1179
+ {
1180
+ "key": "REQUEST_REMOVE",
1181
+ "name": "Request Remove",
1247
1182
  "payload": [
1248
1183
  {
1249
1184
  "name": "id",
@@ -1253,186 +1188,173 @@
1253
1188
  ]
1254
1189
  },
1255
1190
  {
1256
- "key": "CLOSE",
1257
- "name": "Close"
1191
+ "key": "PROCEED_CHECKOUT",
1192
+ "name": "Proceed to Checkout"
1193
+ },
1194
+ {
1195
+ "key": "BACK_TO_CART",
1196
+ "name": "Back to Cart"
1197
+ },
1198
+ {
1199
+ "key": "CONFIRM_ORDER",
1200
+ "name": "Confirm Order"
1258
1201
  }
1259
1202
  ],
1260
1203
  "transitions": [
1261
1204
  {
1262
- "from": "closed",
1263
- "to": "closed",
1205
+ "from": "browsing",
1206
+ "to": "browsing",
1264
1207
  "event": "INIT",
1265
1208
  "effects": [
1266
1209
  [
1267
1210
  "ref",
1268
- "Product"
1269
- ]
1270
- ]
1271
- },
1272
- {
1273
- "from": "closed",
1274
- "to": "open",
1275
- "event": "VIEW",
1276
- "effects": [
1277
- [
1278
- "fetch",
1279
- "Product",
1280
- {
1281
- "id": "@payload.id"
1282
- }
1211
+ "CartItem"
1283
1212
  ],
1284
1213
  [
1285
1214
  "render-ui",
1286
- "modal",
1215
+ "main",
1287
1216
  {
1288
- "type": "stack",
1289
- "direction": "vertical",
1290
- "gap": "md",
1291
- "children": [
1217
+ "type": "dashboard-layout",
1218
+ "appName": "EcommerceApp",
1219
+ "navItems": [
1292
1220
  {
1293
- "type": "stack",
1294
- "direction": "horizontal",
1295
- "gap": "sm",
1296
- "align": "center",
1297
- "children": [
1298
- {
1299
- "type": "icon",
1300
- "name": "eye",
1301
- "size": "md"
1302
- },
1303
- {
1304
- "type": "typography",
1305
- "variant": "h3",
1306
- "content": "@entity.name"
1307
- }
1308
- ]
1221
+ "label": "Products",
1222
+ "href": "/products",
1223
+ "icon": "package"
1309
1224
  },
1310
1225
  {
1311
- "type": "divider"
1226
+ "label": "Cart",
1227
+ "href": "/cart",
1228
+ "icon": "shopping-cart"
1312
1229
  },
1313
1230
  {
1314
- "type": "stack",
1315
- "direction": "horizontal",
1316
- "gap": "md",
1317
- "children": [
1318
- {
1319
- "type": "typography",
1320
- "variant": "caption",
1321
- "content": "Name"
1322
- },
1323
- {
1324
- "type": "typography",
1325
- "variant": "body",
1326
- "content": "@entity.name"
1327
- }
1328
- ]
1231
+ "label": "Checkout",
1232
+ "href": "/checkout",
1233
+ "icon": "credit-card"
1329
1234
  },
1235
+ {
1236
+ "label": "Orders",
1237
+ "href": "/orders",
1238
+ "icon": "clipboard-list"
1239
+ }
1240
+ ],
1241
+ "children": [
1330
1242
  {
1331
1243
  "type": "stack",
1332
- "direction": "horizontal",
1333
- "gap": "md",
1244
+ "direction": "vertical",
1245
+ "gap": "lg",
1334
1246
  "children": [
1335
1247
  {
1336
- "type": "typography",
1337
- "variant": "caption",
1338
- "content": "Description"
1339
- },
1340
- {
1341
- "type": "typography",
1342
- "variant": "body",
1343
- "content": "@entity.description"
1344
- }
1345
- ]
1346
- },
1347
- {
1348
- "type": "stack",
1349
- "direction": "horizontal",
1350
- "gap": "md",
1351
- "children": [
1352
- {
1353
- "type": "typography",
1354
- "variant": "caption",
1355
- "content": "Price"
1248
+ "type": "stack",
1249
+ "direction": "horizontal",
1250
+ "gap": "md",
1251
+ "justify": "space-between",
1252
+ "children": [
1253
+ {
1254
+ "type": "stack",
1255
+ "direction": "horizontal",
1256
+ "gap": "md",
1257
+ "children": [
1258
+ {
1259
+ "type": "icon",
1260
+ "name": "shopping-cart",
1261
+ "size": "lg"
1262
+ },
1263
+ {
1264
+ "type": "typography",
1265
+ "content": "Shopping Cart",
1266
+ "variant": "h2"
1267
+ }
1268
+ ]
1269
+ },
1270
+ {
1271
+ "type": "button",
1272
+ "label": "Add Item",
1273
+ "event": "ADD_ITEM",
1274
+ "variant": "primary",
1275
+ "icon": "plus"
1276
+ }
1277
+ ]
1356
1278
  },
1357
1279
  {
1358
- "type": "typography",
1359
- "variant": "body",
1360
- "content": "@entity.price"
1361
- }
1362
- ]
1363
- },
1364
- {
1365
- "type": "stack",
1366
- "direction": "horizontal",
1367
- "gap": "md",
1368
- "children": [
1369
- {
1370
- "type": "typography",
1371
- "variant": "caption",
1372
- "content": "Category"
1280
+ "type": "divider"
1373
1281
  },
1374
1282
  {
1375
- "type": "typography",
1376
- "variant": "body",
1377
- "content": "@entity.category"
1378
- }
1379
- ]
1380
- },
1381
- {
1382
- "type": "stack",
1383
- "direction": "horizontal",
1384
- "gap": "md",
1385
- "children": [
1386
- {
1387
- "type": "typography",
1388
- "variant": "caption",
1389
- "content": "Sku"
1283
+ "type": "simple-grid",
1284
+ "columns": 3,
1285
+ "children": [
1286
+ {
1287
+ "type": "stat-display",
1288
+ "label": "Items",
1289
+ "value": [
1290
+ "array/len",
1291
+ "@entity"
1292
+ ],
1293
+ "icon": "package"
1294
+ },
1295
+ {
1296
+ "type": "stat-display",
1297
+ "label": "Subtotal",
1298
+ "value": [
1299
+ "array/len",
1300
+ "@entity"
1301
+ ],
1302
+ "icon": "dollar-sign"
1303
+ },
1304
+ {
1305
+ "type": "stat-display",
1306
+ "label": "Total",
1307
+ "value": [
1308
+ "array/len",
1309
+ "@entity"
1310
+ ],
1311
+ "icon": "receipt"
1312
+ }
1313
+ ]
1390
1314
  },
1391
1315
  {
1392
- "type": "typography",
1393
- "variant": "body",
1394
- "content": "@entity.sku"
1395
- }
1396
- ]
1397
- },
1398
- {
1399
- "type": "stack",
1400
- "direction": "horizontal",
1401
- "gap": "md",
1402
- "children": [
1403
- {
1404
- "type": "typography",
1405
- "variant": "caption",
1406
- "content": "In Stock"
1316
+ "type": "divider"
1407
1317
  },
1408
1318
  {
1409
- "type": "typography",
1410
- "variant": "body",
1411
- "content": "@entity.inStock"
1412
- }
1413
- ]
1414
- },
1415
- {
1416
- "type": "divider"
1417
- },
1418
- {
1419
- "type": "stack",
1420
- "direction": "horizontal",
1421
- "gap": "sm",
1422
- "justify": "end",
1423
- "children": [
1424
- {
1425
- "type": "button",
1426
- "label": "Edit",
1427
- "event": "EDIT",
1428
- "variant": "primary",
1429
- "icon": "edit"
1319
+ "type": "data-grid",
1320
+ "entity": "CartItem",
1321
+ "emptyIcon": "inbox",
1322
+ "emptyTitle": "Your cart is empty",
1323
+ "emptyDescription": "Add items to get started.",
1324
+ "itemActions": [
1325
+ {
1326
+ "label": "Remove",
1327
+ "event": "REQUEST_REMOVE",
1328
+ "variant": "danger",
1329
+ "size": "sm"
1330
+ }
1331
+ ],
1332
+ "columns": [
1333
+ {
1334
+ "name": "productName",
1335
+ "label": "Product Name",
1336
+ "variant": "h4",
1337
+ "icon": "shopping-cart"
1338
+ },
1339
+ {
1340
+ "name": "quantity",
1341
+ "label": "Quantity",
1342
+ "variant": "caption",
1343
+ "format": "currency"
1344
+ },
1345
+ {
1346
+ "name": "unitPrice",
1347
+ "label": "Unit Price",
1348
+ "variant": "badge"
1349
+ }
1350
+ ]
1430
1351
  },
1431
1352
  {
1432
1353
  "type": "button",
1433
- "label": "Close",
1434
- "event": "CLOSE",
1435
- "variant": "ghost"
1354
+ "label": "Proceed to Checkout",
1355
+ "event": "PROCEED_CHECKOUT",
1356
+ "variant": "primary",
1357
+ "icon": "arrow-right"
1436
1358
  }
1437
1359
  ]
1438
1360
  }
@@ -1442,306 +1364,13 @@
1442
1364
  ]
1443
1365
  },
1444
1366
  {
1445
- "from": "open",
1446
- "to": "closed",
1447
- "event": "CLOSE",
1367
+ "from": "browsing",
1368
+ "to": "checkout",
1369
+ "event": "PROCEED_CHECKOUT",
1448
1370
  "effects": [
1449
1371
  [
1450
- "render-ui",
1451
- "modal",
1452
- null
1453
- ],
1454
- [
1455
- "notify",
1456
- "Cancelled",
1457
- "info"
1458
- ]
1459
- ]
1460
- }
1461
- ]
1462
- }
1463
- }
1464
- ],
1465
- "pages": [
1466
- {
1467
- "name": "ProductsPage",
1468
- "path": "/products",
1469
- "isInitial": true,
1470
- "traits": [
1471
- {
1472
- "ref": "ProductBrowse"
1473
- },
1474
- {
1475
- "ref": "ProductCreate"
1476
- },
1477
- {
1478
- "ref": "ProductEdit"
1479
- },
1480
- {
1481
- "ref": "ProductView"
1482
- }
1483
- ]
1484
- }
1485
- ]
1486
- },
1487
- {
1488
- "name": "CartItemOrbital",
1489
- "entity": {
1490
- "name": "CartItem",
1491
- "persistence": "persistent",
1492
- "collection": "cartitems",
1493
- "fields": [
1494
- {
1495
- "name": "id",
1496
- "type": "string",
1497
- "required": true
1498
- },
1499
- {
1500
- "name": "productName",
1501
- "type": "string",
1502
- "required": true
1503
- },
1504
- {
1505
- "name": "quantity",
1506
- "type": "number",
1507
- "required": true,
1508
- "default": 1
1509
- },
1510
- {
1511
- "name": "unitPrice",
1512
- "type": "number",
1513
- "required": true
1514
- },
1515
- {
1516
- "name": "totalPrice",
1517
- "type": "number"
1518
- },
1519
- {
1520
- "name": "pendingId",
1521
- "type": "string",
1522
- "default": ""
1523
- }
1524
- ]
1525
- },
1526
- "traits": [
1527
- {
1528
- "name": "CartItemCartBrowse",
1529
- "linkedEntity": "CartItem",
1530
- "category": "interaction",
1531
- "stateMachine": {
1532
- "states": [
1533
- {
1534
- "name": "browsing",
1535
- "isInitial": true
1536
- },
1537
- {
1538
- "name": "checkout"
1539
- }
1540
- ],
1541
- "events": [
1542
- {
1543
- "key": "INIT",
1544
- "name": "Initialize"
1545
- },
1546
- {
1547
- "key": "ADD_ITEM",
1548
- "name": "Add Item"
1549
- },
1550
- {
1551
- "key": "REQUEST_REMOVE",
1552
- "name": "Request Remove",
1553
- "payload": [
1554
- {
1555
- "name": "id",
1556
- "type": "string",
1557
- "required": true
1558
- }
1559
- ]
1560
- },
1561
- {
1562
- "key": "PROCEED_CHECKOUT",
1563
- "name": "Proceed to Checkout"
1564
- },
1565
- {
1566
- "key": "BACK_TO_CART",
1567
- "name": "Back to Cart"
1568
- },
1569
- {
1570
- "key": "CONFIRM_ORDER",
1571
- "name": "Confirm Order"
1572
- }
1573
- ],
1574
- "transitions": [
1575
- {
1576
- "from": "browsing",
1577
- "to": "browsing",
1578
- "event": "INIT",
1579
- "effects": [
1580
- [
1581
- "ref",
1582
- "CartItem"
1583
- ],
1584
- [
1585
- "render-ui",
1586
- "main",
1587
- {
1588
- "type": "dashboard-layout",
1589
- "appName": "EcommerceApp",
1590
- "navItems": [
1591
- {
1592
- "label": "Products",
1593
- "href": "/products",
1594
- "icon": "package"
1595
- },
1596
- {
1597
- "label": "Cart",
1598
- "href": "/cart",
1599
- "icon": "shopping-cart"
1600
- },
1601
- {
1602
- "label": "Checkout",
1603
- "href": "/checkout",
1604
- "icon": "credit-card"
1605
- },
1606
- {
1607
- "label": "Orders",
1608
- "href": "/orders",
1609
- "icon": "clipboard-list"
1610
- }
1611
- ],
1612
- "children": [
1613
- {
1614
- "type": "stack",
1615
- "direction": "vertical",
1616
- "gap": "lg",
1617
- "children": [
1618
- {
1619
- "type": "stack",
1620
- "direction": "horizontal",
1621
- "gap": "md",
1622
- "justify": "space-between",
1623
- "children": [
1624
- {
1625
- "type": "stack",
1626
- "direction": "horizontal",
1627
- "gap": "md",
1628
- "children": [
1629
- {
1630
- "type": "icon",
1631
- "name": "shopping-cart",
1632
- "size": "lg"
1633
- },
1634
- {
1635
- "type": "typography",
1636
- "content": "Shopping Cart",
1637
- "variant": "h2"
1638
- }
1639
- ]
1640
- },
1641
- {
1642
- "type": "button",
1643
- "label": "Add Item",
1644
- "event": "ADD_ITEM",
1645
- "variant": "primary",
1646
- "icon": "plus"
1647
- }
1648
- ]
1649
- },
1650
- {
1651
- "type": "divider"
1652
- },
1653
- {
1654
- "type": "simple-grid",
1655
- "columns": 3,
1656
- "children": [
1657
- {
1658
- "type": "stat-display",
1659
- "label": "Items",
1660
- "value": [
1661
- "array/len",
1662
- "@entity"
1663
- ],
1664
- "icon": "package"
1665
- },
1666
- {
1667
- "type": "stat-display",
1668
- "label": "Subtotal",
1669
- "value": [
1670
- "array/len",
1671
- "@entity"
1672
- ],
1673
- "icon": "dollar-sign"
1674
- },
1675
- {
1676
- "type": "stat-display",
1677
- "label": "Total",
1678
- "value": [
1679
- "array/len",
1680
- "@entity"
1681
- ],
1682
- "icon": "receipt"
1683
- }
1684
- ]
1685
- },
1686
- {
1687
- "type": "divider"
1688
- },
1689
- {
1690
- "type": "data-grid",
1691
- "entity": "CartItem",
1692
- "emptyIcon": "inbox",
1693
- "emptyTitle": "Your cart is empty",
1694
- "emptyDescription": "Add items to get started.",
1695
- "itemActions": [
1696
- {
1697
- "label": "Remove",
1698
- "event": "REQUEST_REMOVE",
1699
- "variant": "danger",
1700
- "size": "sm"
1701
- }
1702
- ],
1703
- "columns": [
1704
- {
1705
- "name": "productName",
1706
- "label": "Product Name",
1707
- "variant": "h4",
1708
- "icon": "shopping-cart"
1709
- },
1710
- {
1711
- "name": "quantity",
1712
- "label": "Quantity",
1713
- "variant": "caption",
1714
- "format": "currency"
1715
- },
1716
- {
1717
- "name": "unitPrice",
1718
- "label": "Unit Price",
1719
- "variant": "badge"
1720
- }
1721
- ]
1722
- },
1723
- {
1724
- "type": "button",
1725
- "label": "Proceed to Checkout",
1726
- "event": "PROCEED_CHECKOUT",
1727
- "variant": "primary",
1728
- "icon": "arrow-right"
1729
- }
1730
- ]
1731
- }
1732
- ]
1733
- }
1734
- ]
1735
- ]
1736
- },
1737
- {
1738
- "from": "browsing",
1739
- "to": "checkout",
1740
- "event": "PROCEED_CHECKOUT",
1741
- "effects": [
1742
- [
1743
- "ref",
1744
- "CartItem"
1372
+ "ref",
1373
+ "CartItem"
1745
1374
  ],
1746
1375
  [
1747
1376
  "render-ui",
@@ -1970,6 +1599,11 @@
1970
1599
  "name": "CartItemAddItem",
1971
1600
  "linkedEntity": "CartItem",
1972
1601
  "category": "interaction",
1602
+ "emits": [
1603
+ {
1604
+ "event": "SAVE"
1605
+ }
1606
+ ],
1973
1607
  "stateMachine": {
1974
1608
  "states": [
1975
1609
  {
@@ -2104,10 +1738,6 @@
2104
1738
  "render-ui",
2105
1739
  "modal",
2106
1740
  null
2107
- ],
2108
- [
2109
- "notify",
2110
- "CartItem created successfully"
2111
1741
  ]
2112
1742
  ]
2113
1743
  }
@@ -2118,6 +1748,11 @@
2118
1748
  "name": "CartItemRemoveConfirm",
2119
1749
  "linkedEntity": "CartItem",
2120
1750
  "category": "interaction",
1751
+ "emits": [
1752
+ {
1753
+ "event": "CONFIRM_REMOVE"
1754
+ }
1755
+ ],
2121
1756
  "stateMachine": {
2122
1757
  "states": [
2123
1758
  {
@@ -2265,10 +1900,6 @@
2265
1900
  [
2266
1901
  "ref",
2267
1902
  "CartItem"
2268
- ],
2269
- [
2270
- "notify",
2271
- "CartItem deleted successfully"
2272
1903
  ]
2273
1904
  ]
2274
1905
  },
@@ -2372,660 +2003,71 @@
2372
2003
  }
2373
2004
  ]
2374
2005
  },
2375
- "traits": [
2376
- {
2377
- "name": "CheckoutWizard",
2378
- "linkedEntity": "Checkout",
2379
- "category": "interaction",
2380
- "stateMachine": {
2381
- "states": [
2382
- {
2383
- "name": "step1",
2384
- "isInitial": true
2385
- },
2386
- {
2387
- "name": "step2"
2388
- },
2389
- {
2390
- "name": "step3"
2391
- },
2392
- {
2393
- "name": "review"
2394
- },
2395
- {
2396
- "name": "complete"
2397
- }
2398
- ],
2399
- "events": [
2400
- {
2401
- "key": "INIT",
2402
- "name": "Initialize"
2403
- },
2404
- {
2405
- "key": "NEXT",
2406
- "name": "Next Step",
2407
- "payload": [
2408
- {
2409
- "name": "data",
2410
- "type": "object",
2411
- "required": true
2412
- }
2413
- ]
2414
- },
2415
- {
2416
- "key": "PREV",
2417
- "name": "Previous Step"
2418
- },
2419
- {
2420
- "key": "COMPLETE",
2421
- "name": "Complete Wizard",
2422
- "payload": [
2423
- {
2424
- "name": "data",
2425
- "type": "object",
2426
- "required": true
2427
- }
2428
- ]
2429
- },
2430
- {
2431
- "key": "RESTART",
2432
- "name": "Restart Wizard"
2433
- }
2434
- ],
2435
- "transitions": [
2436
- {
2437
- "from": "step1",
2438
- "to": "step1",
2439
- "event": "INIT",
2440
- "effects": [
2441
- [
2442
- "fetch",
2443
- "Checkout"
2444
- ],
2445
- [
2446
- "render-ui",
2447
- "main",
2448
- {
2449
- "type": "dashboard-layout",
2450
- "appName": "EcommerceApp",
2451
- "navItems": [
2452
- {
2453
- "label": "Products",
2454
- "href": "/products",
2455
- "icon": "package"
2456
- },
2457
- {
2458
- "label": "Cart",
2459
- "href": "/cart",
2460
- "icon": "shopping-cart"
2461
- },
2462
- {
2463
- "label": "Checkout",
2464
- "href": "/checkout",
2465
- "icon": "credit-card"
2466
- },
2467
- {
2468
- "label": "Orders",
2469
- "href": "/orders",
2470
- "icon": "clipboard-list"
2471
- }
2472
- ],
2473
- "children": [
2474
- {
2475
- "type": "container",
2476
- "maxWidth": "lg",
2477
- "padding": "lg",
2478
- "children": [
2479
- {
2480
- "type": "stack",
2481
- "direction": "vertical",
2482
- "gap": "lg",
2483
- "children": [
2484
- {
2485
- "type": "stack",
2486
- "direction": "horizontal",
2487
- "gap": "sm",
2488
- "align": "center",
2489
- "children": [
2490
- {
2491
- "type": "icon",
2492
- "name": "credit-card",
2493
- "size": "lg"
2494
- },
2495
- {
2496
- "type": "typography",
2497
- "content": "Checkout",
2498
- "variant": "h2"
2499
- }
2500
- ]
2501
- },
2502
- {
2503
- "type": "progress-dots",
2504
- "count": 3,
2505
- "currentIndex": 0
2506
- },
2507
- {
2508
- "type": "wizard-progress",
2509
- "steps": [
2510
- "Customer Info",
2511
- "Shipping",
2512
- "Payment"
2513
- ],
2514
- "currentStep": 0
2515
- },
2516
- {
2517
- "type": "divider"
2518
- },
2519
- {
2520
- "type": "typography",
2521
- "content": "Customer Info",
2522
- "variant": "h3"
2523
- },
2524
- {
2525
- "type": "form-section",
2526
- "entity": "Checkout",
2527
- "mode": "create",
2528
- "submitEvent": "NEXT",
2529
- "cancelEvent": "INIT",
2530
- "fields": [
2531
- "customerName",
2532
- "email"
2533
- ]
2534
- },
2535
- {
2536
- "type": "stack",
2537
- "direction": "horizontal",
2538
- "gap": "sm",
2539
- "justify": "end",
2540
- "children": [
2541
- {
2542
- "type": "button",
2543
- "label": "Next",
2544
- "event": "NEXT",
2545
- "variant": "primary",
2546
- "icon": "arrow-right"
2547
- }
2548
- ]
2549
- }
2550
- ]
2551
- }
2552
- ]
2553
- }
2554
- ]
2555
- }
2556
- ]
2557
- ]
2558
- },
2559
- {
2560
- "from": "step1",
2561
- "to": "step2",
2562
- "event": "NEXT",
2563
- "effects": [
2564
- [
2565
- "fetch",
2566
- "Checkout"
2567
- ],
2568
- [
2569
- "render-ui",
2570
- "main",
2571
- {
2572
- "type": "dashboard-layout",
2573
- "appName": "EcommerceApp",
2574
- "navItems": [
2575
- {
2576
- "label": "Products",
2577
- "href": "/products",
2578
- "icon": "package"
2579
- },
2580
- {
2581
- "label": "Cart",
2582
- "href": "/cart",
2583
- "icon": "shopping-cart"
2584
- },
2585
- {
2586
- "label": "Checkout",
2587
- "href": "/checkout",
2588
- "icon": "credit-card"
2589
- },
2590
- {
2591
- "label": "Orders",
2592
- "href": "/orders",
2593
- "icon": "clipboard-list"
2594
- }
2595
- ],
2596
- "children": [
2597
- {
2598
- "type": "container",
2599
- "maxWidth": "lg",
2600
- "padding": "lg",
2601
- "children": [
2602
- {
2603
- "type": "stack",
2604
- "direction": "vertical",
2605
- "gap": "lg",
2606
- "children": [
2607
- {
2608
- "type": "stack",
2609
- "direction": "horizontal",
2610
- "gap": "sm",
2611
- "align": "center",
2612
- "children": [
2613
- {
2614
- "type": "icon",
2615
- "name": "credit-card",
2616
- "size": "lg"
2617
- },
2618
- {
2619
- "type": "typography",
2620
- "content": "Checkout",
2621
- "variant": "h2"
2622
- }
2623
- ]
2624
- },
2625
- {
2626
- "type": "progress-dots",
2627
- "count": 3,
2628
- "currentIndex": 1
2629
- },
2630
- {
2631
- "type": "wizard-progress",
2632
- "steps": [
2633
- "Customer Info",
2634
- "Shipping",
2635
- "Payment"
2636
- ],
2637
- "currentStep": 1
2638
- },
2639
- {
2640
- "type": "divider"
2641
- },
2642
- {
2643
- "type": "typography",
2644
- "content": "Shipping",
2645
- "variant": "h3"
2646
- },
2647
- {
2648
- "type": "form-section",
2649
- "entity": "Checkout",
2650
- "mode": "create",
2651
- "submitEvent": "NEXT",
2652
- "cancelEvent": "PREV",
2653
- "fields": [
2654
- "shippingAddress"
2655
- ]
2656
- },
2657
- {
2658
- "type": "stack",
2659
- "direction": "horizontal",
2660
- "gap": "sm",
2661
- "justify": "end",
2662
- "children": [
2663
- {
2664
- "type": "button",
2665
- "label": "Back",
2666
- "event": "PREV",
2667
- "variant": "ghost",
2668
- "icon": "arrow-left"
2669
- },
2670
- {
2671
- "type": "button",
2672
- "label": "Next",
2673
- "event": "NEXT",
2674
- "variant": "primary",
2675
- "icon": "arrow-right"
2676
- }
2677
- ]
2678
- }
2679
- ]
2680
- }
2681
- ]
2682
- }
2683
- ]
2684
- }
2685
- ]
2686
- ]
2687
- },
2688
- {
2689
- "from": "step2",
2690
- "to": "step3",
2691
- "event": "NEXT",
2692
- "effects": [
2693
- [
2694
- "fetch",
2695
- "Checkout"
2696
- ],
2697
- [
2698
- "render-ui",
2699
- "main",
2700
- {
2701
- "type": "dashboard-layout",
2702
- "appName": "EcommerceApp",
2703
- "navItems": [
2704
- {
2705
- "label": "Products",
2706
- "href": "/products",
2707
- "icon": "package"
2708
- },
2709
- {
2710
- "label": "Cart",
2711
- "href": "/cart",
2712
- "icon": "shopping-cart"
2713
- },
2714
- {
2715
- "label": "Checkout",
2716
- "href": "/checkout",
2717
- "icon": "credit-card"
2718
- },
2719
- {
2720
- "label": "Orders",
2721
- "href": "/orders",
2722
- "icon": "clipboard-list"
2723
- }
2724
- ],
2725
- "children": [
2726
- {
2727
- "type": "container",
2728
- "maxWidth": "lg",
2729
- "padding": "lg",
2730
- "children": [
2731
- {
2732
- "type": "stack",
2733
- "direction": "vertical",
2734
- "gap": "lg",
2735
- "children": [
2736
- {
2737
- "type": "stack",
2738
- "direction": "horizontal",
2739
- "gap": "sm",
2740
- "align": "center",
2741
- "children": [
2742
- {
2743
- "type": "icon",
2744
- "name": "credit-card",
2745
- "size": "lg"
2746
- },
2747
- {
2748
- "type": "typography",
2749
- "content": "Checkout",
2750
- "variant": "h2"
2751
- }
2752
- ]
2753
- },
2754
- {
2755
- "type": "progress-dots",
2756
- "count": 3,
2757
- "currentIndex": 2
2758
- },
2759
- {
2760
- "type": "wizard-progress",
2761
- "steps": [
2762
- "Customer Info",
2763
- "Shipping",
2764
- "Payment"
2765
- ],
2766
- "currentStep": 2
2767
- },
2768
- {
2769
- "type": "divider"
2770
- },
2771
- {
2772
- "type": "typography",
2773
- "content": "Payment",
2774
- "variant": "h3"
2775
- },
2776
- {
2777
- "type": "form-section",
2778
- "entity": "Checkout",
2779
- "mode": "create",
2780
- "submitEvent": "NEXT",
2781
- "cancelEvent": "PREV",
2782
- "fields": [
2783
- "paymentMethod"
2784
- ]
2785
- },
2786
- {
2787
- "type": "stack",
2788
- "direction": "horizontal",
2789
- "gap": "sm",
2790
- "justify": "end",
2791
- "children": [
2792
- {
2793
- "type": "button",
2794
- "label": "Back",
2795
- "event": "PREV",
2796
- "variant": "ghost",
2797
- "icon": "arrow-left"
2798
- },
2799
- {
2800
- "type": "button",
2801
- "label": "Next",
2802
- "event": "NEXT",
2803
- "variant": "primary",
2804
- "icon": "arrow-right"
2805
- }
2806
- ]
2807
- }
2808
- ]
2809
- }
2810
- ]
2811
- }
2812
- ]
2813
- }
2814
- ]
2815
- ]
2816
- },
2817
- {
2818
- "from": "step3",
2819
- "to": "review",
2820
- "event": "NEXT",
2821
- "effects": [
2822
- [
2823
- "fetch",
2824
- "Checkout"
2825
- ],
2826
- [
2827
- "render-ui",
2828
- "main",
2829
- {
2830
- "type": "dashboard-layout",
2831
- "appName": "EcommerceApp",
2832
- "navItems": [
2833
- {
2834
- "label": "Products",
2835
- "href": "/products",
2836
- "icon": "package"
2837
- },
2838
- {
2839
- "label": "Cart",
2840
- "href": "/cart",
2841
- "icon": "shopping-cart"
2842
- },
2843
- {
2844
- "label": "Checkout",
2845
- "href": "/checkout",
2846
- "icon": "credit-card"
2847
- },
2848
- {
2849
- "label": "Orders",
2850
- "href": "/orders",
2851
- "icon": "clipboard-list"
2852
- }
2853
- ],
2854
- "children": [
2855
- {
2856
- "type": "stack",
2857
- "direction": "vertical",
2858
- "gap": "lg",
2859
- "children": [
2860
- {
2861
- "type": "stack",
2862
- "direction": "horizontal",
2863
- "gap": "sm",
2864
- "align": "center",
2865
- "children": [
2866
- {
2867
- "type": "icon",
2868
- "name": "credit-card",
2869
- "size": "lg"
2870
- },
2871
- {
2872
- "type": "typography",
2873
- "content": "Checkout",
2874
- "variant": "h2"
2875
- }
2876
- ]
2877
- },
2878
- {
2879
- "type": "badge",
2880
- "label": "Review"
2881
- },
2882
- {
2883
- "type": "wizard-progress",
2884
- "steps": [
2885
- "Customer Info",
2886
- "Shipping",
2887
- "Payment"
2888
- ],
2889
- "currentStep": 3
2890
- },
2891
- {
2892
- "type": "divider"
2893
- },
2894
- {
2895
- "type": "stack",
2896
- "direction": "vertical",
2897
- "gap": "sm",
2898
- "entity": "Checkout",
2899
- "children": [
2900
- {
2901
- "type": "stack",
2902
- "direction": "horizontal",
2903
- "gap": "md",
2904
- "justify": "space-between",
2905
- "children": [
2906
- {
2907
- "type": "typography",
2908
- "variant": "caption",
2909
- "content": "Customer Name"
2910
- },
2911
- {
2912
- "type": "typography",
2913
- "variant": "body",
2914
- "content": "@entity.customerName"
2915
- }
2916
- ]
2917
- },
2918
- {
2919
- "type": "stack",
2920
- "direction": "horizontal",
2921
- "gap": "md",
2922
- "justify": "space-between",
2923
- "children": [
2924
- {
2925
- "type": "typography",
2926
- "variant": "caption",
2927
- "content": "Email"
2928
- },
2929
- {
2930
- "type": "typography",
2931
- "variant": "body",
2932
- "content": "@entity.email"
2933
- }
2934
- ]
2935
- },
2936
- {
2937
- "type": "stack",
2938
- "direction": "horizontal",
2939
- "gap": "md",
2940
- "justify": "space-between",
2941
- "children": [
2942
- {
2943
- "type": "typography",
2944
- "variant": "caption",
2945
- "content": "Shipping Address"
2946
- },
2947
- {
2948
- "type": "typography",
2949
- "variant": "body",
2950
- "content": "@entity.shippingAddress"
2951
- }
2952
- ]
2953
- },
2954
- {
2955
- "type": "stack",
2956
- "direction": "horizontal",
2957
- "gap": "md",
2958
- "justify": "space-between",
2959
- "children": [
2960
- {
2961
- "type": "typography",
2962
- "variant": "caption",
2963
- "content": "Payment Method"
2964
- },
2965
- {
2966
- "type": "typography",
2967
- "variant": "body",
2968
- "content": "@entity.paymentMethod"
2969
- }
2970
- ]
2971
- },
2972
- {
2973
- "type": "stack",
2974
- "direction": "horizontal",
2975
- "gap": "md",
2976
- "justify": "space-between",
2977
- "children": [
2978
- {
2979
- "type": "typography",
2980
- "variant": "caption",
2981
- "content": "Order Total"
2982
- },
2983
- {
2984
- "type": "typography",
2985
- "variant": "body",
2986
- "content": "@entity.orderTotal"
2987
- }
2988
- ]
2989
- },
2990
- {
2991
- "type": "stack",
2992
- "direction": "horizontal",
2993
- "gap": "md",
2994
- "justify": "space-between",
2995
- "children": [
2996
- {
2997
- "type": "typography",
2998
- "variant": "caption",
2999
- "content": "Status"
3000
- },
3001
- {
3002
- "type": "typography",
3003
- "variant": "body",
3004
- "content": "@entity.status"
3005
- }
3006
- ]
3007
- }
3008
- ]
3009
- },
3010
- {
3011
- "type": "wizard-navigation",
3012
- "currentStep": 3,
3013
- "totalSteps": 4,
3014
- "showBack": true,
3015
- "showComplete": true,
3016
- "showNext": false
3017
- }
3018
- ]
3019
- }
3020
- ]
3021
- }
3022
- ]
2006
+ "traits": [
2007
+ {
2008
+ "name": "CheckoutWizard",
2009
+ "linkedEntity": "Checkout",
2010
+ "category": "interaction",
2011
+ "stateMachine": {
2012
+ "states": [
2013
+ {
2014
+ "name": "step1",
2015
+ "isInitial": true
2016
+ },
2017
+ {
2018
+ "name": "step2"
2019
+ },
2020
+ {
2021
+ "name": "step3"
2022
+ },
2023
+ {
2024
+ "name": "review"
2025
+ },
2026
+ {
2027
+ "name": "complete"
2028
+ }
2029
+ ],
2030
+ "events": [
2031
+ {
2032
+ "key": "INIT",
2033
+ "name": "Initialize"
2034
+ },
2035
+ {
2036
+ "key": "NEXT",
2037
+ "name": "Next Step",
2038
+ "payload": [
2039
+ {
2040
+ "name": "data",
2041
+ "type": "object",
2042
+ "required": true
2043
+ }
3023
2044
  ]
3024
2045
  },
3025
2046
  {
3026
- "from": "step2",
2047
+ "key": "PREV",
2048
+ "name": "Previous Step"
2049
+ },
2050
+ {
2051
+ "key": "COMPLETE",
2052
+ "name": "Complete Wizard",
2053
+ "payload": [
2054
+ {
2055
+ "name": "data",
2056
+ "type": "object",
2057
+ "required": true
2058
+ }
2059
+ ]
2060
+ },
2061
+ {
2062
+ "key": "RESTART",
2063
+ "name": "Restart Wizard"
2064
+ }
2065
+ ],
2066
+ "transitions": [
2067
+ {
2068
+ "from": "step1",
3027
2069
  "to": "step1",
3028
- "event": "PREV",
2070
+ "event": "INIT",
3029
2071
  "effects": [
3030
2072
  [
3031
2073
  "fetch",
@@ -3146,9 +2188,9 @@
3146
2188
  ]
3147
2189
  },
3148
2190
  {
3149
- "from": "step3",
2191
+ "from": "step1",
3150
2192
  "to": "step2",
3151
- "event": "PREV",
2193
+ "event": "NEXT",
3152
2194
  "effects": [
3153
2195
  [
3154
2196
  "fetch",
@@ -3275,9 +2317,9 @@
3275
2317
  ]
3276
2318
  },
3277
2319
  {
3278
- "from": "review",
2320
+ "from": "step2",
3279
2321
  "to": "step3",
3280
- "event": "PREV",
2322
+ "event": "NEXT",
3281
2323
  "effects": [
3282
2324
  [
3283
2325
  "fetch",
@@ -3404,20 +2446,13 @@
3404
2446
  ]
3405
2447
  },
3406
2448
  {
3407
- "from": "review",
3408
- "to": "complete",
3409
- "event": "COMPLETE",
2449
+ "from": "step3",
2450
+ "to": "review",
2451
+ "event": "NEXT",
3410
2452
  "effects": [
3411
2453
  [
3412
- "persist",
3413
- "create",
3414
- "Checkout",
3415
- "@payload.data"
3416
- ],
3417
- [
3418
- "notify",
3419
- "success",
3420
- "Checkout created successfully"
2454
+ "fetch",
2455
+ "Checkout"
3421
2456
  ],
3422
2457
  [
3423
2458
  "render-ui",
@@ -3452,152 +2487,164 @@
3452
2487
  "type": "stack",
3453
2488
  "direction": "vertical",
3454
2489
  "gap": "lg",
3455
- "align": "center",
3456
2490
  "children": [
3457
2491
  {
3458
- "type": "icon",
3459
- "name": "check-circle",
3460
- "size": "lg"
2492
+ "type": "stack",
2493
+ "direction": "horizontal",
2494
+ "gap": "sm",
2495
+ "align": "center",
2496
+ "children": [
2497
+ {
2498
+ "type": "icon",
2499
+ "name": "credit-card",
2500
+ "size": "lg"
2501
+ },
2502
+ {
2503
+ "type": "typography",
2504
+ "content": "Checkout",
2505
+ "variant": "h2"
2506
+ }
2507
+ ]
3461
2508
  },
3462
2509
  {
3463
- "type": "typography",
3464
- "content": "Order Placed",
3465
- "variant": "h2"
2510
+ "type": "badge",
2511
+ "label": "Review"
3466
2512
  },
3467
2513
  {
3468
- "type": "typography",
3469
- "content": "Your order has been placed successfully.",
3470
- "variant": "body"
2514
+ "type": "wizard-progress",
2515
+ "steps": [
2516
+ "Customer Info",
2517
+ "Shipping",
2518
+ "Payment"
2519
+ ],
2520
+ "currentStep": 3
3471
2521
  },
3472
2522
  {
3473
- "type": "button",
3474
- "label": "Start New",
3475
- "event": "RESTART",
3476
- "variant": "primary",
3477
- "icon": "refresh-cw"
3478
- }
3479
- ]
3480
- }
3481
- ]
3482
- }
3483
- ]
3484
- ]
3485
- },
3486
- {
3487
- "from": "complete",
3488
- "to": "step1",
3489
- "event": "RESTART",
3490
- "effects": [
3491
- [
3492
- "fetch",
3493
- "Checkout"
3494
- ],
3495
- [
3496
- "render-ui",
3497
- "main",
3498
- {
3499
- "type": "dashboard-layout",
3500
- "appName": "EcommerceApp",
3501
- "navItems": [
3502
- {
3503
- "label": "Products",
3504
- "href": "/products",
3505
- "icon": "package"
3506
- },
3507
- {
3508
- "label": "Cart",
3509
- "href": "/cart",
3510
- "icon": "shopping-cart"
3511
- },
3512
- {
3513
- "label": "Checkout",
3514
- "href": "/checkout",
3515
- "icon": "credit-card"
3516
- },
3517
- {
3518
- "label": "Orders",
3519
- "href": "/orders",
3520
- "icon": "clipboard-list"
3521
- }
3522
- ],
3523
- "children": [
3524
- {
3525
- "type": "container",
3526
- "maxWidth": "lg",
3527
- "padding": "lg",
3528
- "children": [
2523
+ "type": "divider"
2524
+ },
3529
2525
  {
3530
2526
  "type": "stack",
3531
2527
  "direction": "vertical",
3532
- "gap": "lg",
2528
+ "gap": "sm",
2529
+ "entity": "Checkout",
3533
2530
  "children": [
3534
2531
  {
3535
2532
  "type": "stack",
3536
2533
  "direction": "horizontal",
3537
- "gap": "sm",
3538
- "align": "center",
2534
+ "gap": "md",
2535
+ "justify": "space-between",
3539
2536
  "children": [
3540
2537
  {
3541
- "type": "icon",
3542
- "name": "credit-card",
3543
- "size": "lg"
2538
+ "type": "typography",
2539
+ "variant": "caption",
2540
+ "content": "Customer Name"
3544
2541
  },
3545
2542
  {
3546
2543
  "type": "typography",
3547
- "content": "Checkout",
3548
- "variant": "h2"
2544
+ "variant": "body",
2545
+ "content": "@entity.customerName"
3549
2546
  }
3550
2547
  ]
3551
2548
  },
3552
2549
  {
3553
- "type": "progress-dots",
3554
- "count": 3,
3555
- "currentIndex": 0
3556
- },
3557
- {
3558
- "type": "wizard-progress",
3559
- "steps": [
3560
- "Customer Info",
3561
- "Shipping",
3562
- "Payment"
3563
- ],
3564
- "currentStep": 0
2550
+ "type": "stack",
2551
+ "direction": "horizontal",
2552
+ "gap": "md",
2553
+ "justify": "space-between",
2554
+ "children": [
2555
+ {
2556
+ "type": "typography",
2557
+ "variant": "caption",
2558
+ "content": "Email"
2559
+ },
2560
+ {
2561
+ "type": "typography",
2562
+ "variant": "body",
2563
+ "content": "@entity.email"
2564
+ }
2565
+ ]
3565
2566
  },
3566
2567
  {
3567
- "type": "divider"
2568
+ "type": "stack",
2569
+ "direction": "horizontal",
2570
+ "gap": "md",
2571
+ "justify": "space-between",
2572
+ "children": [
2573
+ {
2574
+ "type": "typography",
2575
+ "variant": "caption",
2576
+ "content": "Shipping Address"
2577
+ },
2578
+ {
2579
+ "type": "typography",
2580
+ "variant": "body",
2581
+ "content": "@entity.shippingAddress"
2582
+ }
2583
+ ]
3568
2584
  },
3569
2585
  {
3570
- "type": "typography",
3571
- "content": "Customer Info",
3572
- "variant": "h3"
2586
+ "type": "stack",
2587
+ "direction": "horizontal",
2588
+ "gap": "md",
2589
+ "justify": "space-between",
2590
+ "children": [
2591
+ {
2592
+ "type": "typography",
2593
+ "variant": "caption",
2594
+ "content": "Payment Method"
2595
+ },
2596
+ {
2597
+ "type": "typography",
2598
+ "variant": "body",
2599
+ "content": "@entity.paymentMethod"
2600
+ }
2601
+ ]
3573
2602
  },
3574
2603
  {
3575
- "type": "form-section",
3576
- "entity": "Checkout",
3577
- "mode": "create",
3578
- "submitEvent": "NEXT",
3579
- "cancelEvent": "INIT",
3580
- "fields": [
3581
- "customerName",
3582
- "email"
2604
+ "type": "stack",
2605
+ "direction": "horizontal",
2606
+ "gap": "md",
2607
+ "justify": "space-between",
2608
+ "children": [
2609
+ {
2610
+ "type": "typography",
2611
+ "variant": "caption",
2612
+ "content": "Order Total"
2613
+ },
2614
+ {
2615
+ "type": "typography",
2616
+ "variant": "body",
2617
+ "content": "@entity.orderTotal"
2618
+ }
3583
2619
  ]
3584
2620
  },
3585
2621
  {
3586
2622
  "type": "stack",
3587
2623
  "direction": "horizontal",
3588
- "gap": "sm",
3589
- "justify": "end",
2624
+ "gap": "md",
2625
+ "justify": "space-between",
3590
2626
  "children": [
3591
2627
  {
3592
- "type": "button",
3593
- "label": "Next",
3594
- "event": "NEXT",
3595
- "variant": "primary",
3596
- "icon": "arrow-right"
2628
+ "type": "typography",
2629
+ "variant": "caption",
2630
+ "content": "Status"
2631
+ },
2632
+ {
2633
+ "type": "typography",
2634
+ "variant": "body",
2635
+ "content": "@entity.status"
3597
2636
  }
3598
2637
  ]
3599
2638
  }
3600
2639
  ]
2640
+ },
2641
+ {
2642
+ "type": "wizard-navigation",
2643
+ "currentStep": 3,
2644
+ "totalSteps": 4,
2645
+ "showBack": true,
2646
+ "showComplete": true,
2647
+ "showNext": false
3601
2648
  }
3602
2649
  ]
3603
2650
  }
@@ -3607,9 +2654,9 @@
3607
2654
  ]
3608
2655
  },
3609
2656
  {
3610
- "from": "complete",
2657
+ "from": "step2",
3611
2658
  "to": "step1",
3612
- "event": "INIT",
2659
+ "event": "PREV",
3613
2660
  "effects": [
3614
2661
  [
3615
2662
  "fetch",
@@ -3728,221 +2775,15 @@
3728
2775
  }
3729
2776
  ]
3730
2777
  ]
3731
- }
3732
- ]
3733
- },
3734
- "listens": [
3735
- {
3736
- "event": "CHECKOUT_STARTED",
3737
- "triggers": "INIT",
3738
- "scope": "external"
3739
- }
3740
- ],
3741
- "emits": [
3742
- {
3743
- "event": "ORDER_PLACED",
3744
- "payload": [
3745
- {
3746
- "name": "id",
3747
- "type": "string",
3748
- "required": true
3749
- }
3750
- ],
3751
- "scope": "external"
3752
- }
3753
- ]
3754
- }
3755
- ],
3756
- "pages": [
3757
- {
3758
- "name": "CheckoutPage",
3759
- "path": "/checkout",
3760
- "traits": [
3761
- {
3762
- "ref": "CheckoutWizard"
3763
- }
3764
- ]
3765
- }
3766
- ]
3767
- },
3768
- {
3769
- "name": "OrderRecordOrbital",
3770
- "entity": {
3771
- "name": "OrderRecord",
3772
- "persistence": "persistent",
3773
- "collection": "orderrecords",
3774
- "fields": [
3775
- {
3776
- "name": "id",
3777
- "type": "string",
3778
- "required": true
3779
- },
3780
- {
3781
- "name": "customerName",
3782
- "type": "string",
3783
- "required": true
3784
- },
3785
- {
3786
- "name": "email",
3787
- "type": "string",
3788
- "required": true
3789
- },
3790
- {
3791
- "name": "shippingAddress",
3792
- "type": "string",
3793
- "required": true
3794
- },
3795
- {
3796
- "name": "paymentMethod",
3797
- "type": "string",
3798
- "required": true
3799
- },
3800
- {
3801
- "name": "orderTotal",
3802
- "type": "number"
3803
- },
3804
- {
3805
- "name": "status",
3806
- "type": "string",
3807
- "default": "pending",
3808
- "values": [
3809
- "pending",
3810
- "processing",
3811
- "shipped",
3812
- "delivered",
3813
- "cancelled"
3814
- ]
3815
- }
3816
- ]
3817
- },
3818
- "traits": [
3819
- {
3820
- "name": "OrderRecordBrowse",
3821
- "linkedEntity": "OrderRecord",
3822
- "category": "interaction",
3823
- "listens": [
3824
- {
3825
- "event": "ORDER_RECORD_CREATED",
3826
- "triggers": "ORDER_RECORD_CREATED"
3827
- },
3828
- {
3829
- "event": "ORDER_RECORD_UPDATED",
3830
- "triggers": "ORDER_RECORD_UPDATED"
3831
- },
3832
- {
3833
- "event": "ORDER_PLACED",
3834
- "triggers": "INIT",
3835
- "scope": "external"
3836
- }
3837
- ],
3838
- "stateMachine": {
3839
- "states": [
3840
- {
3841
- "name": "browsing",
3842
- "isInitial": true
3843
- },
3844
- {
3845
- "name": "deleting"
3846
- }
3847
- ],
3848
- "events": [
3849
- {
3850
- "key": "INIT",
3851
- "name": "Initialize"
3852
- },
3853
- {
3854
- "key": "CREATE",
3855
- "name": "CREATE"
3856
- },
3857
- {
3858
- "key": "VIEW",
3859
- "name": "VIEW",
3860
- "payload": [
3861
- {
3862
- "name": "id",
3863
- "type": "string",
3864
- "required": true
3865
- },
3866
- {
3867
- "name": "row",
3868
- "type": "object"
3869
- }
3870
- ]
3871
- },
3872
- {
3873
- "key": "EDIT",
3874
- "name": "EDIT",
3875
- "payload": [
3876
- {
3877
- "name": "id",
3878
- "type": "string",
3879
- "required": true
3880
- },
3881
- {
3882
- "name": "row",
3883
- "type": "object"
3884
- }
3885
- ]
3886
- },
3887
- {
3888
- "key": "DELETE",
3889
- "name": "DELETE",
3890
- "payload": [
3891
- {
3892
- "name": "id",
3893
- "type": "string",
3894
- "required": true
3895
- },
3896
- {
3897
- "name": "row",
3898
- "type": "object"
3899
- }
3900
- ]
3901
- },
3902
- {
3903
- "key": "ORDER_RECORD_CREATED",
3904
- "name": "ORDER_RECORD_CREATED",
3905
- "payload": [
3906
- {
3907
- "name": "data",
3908
- "type": "object",
3909
- "required": true
3910
- }
3911
- ]
3912
- },
3913
- {
3914
- "key": "ORDER_RECORD_UPDATED",
3915
- "name": "ORDER_RECORD_UPDATED",
3916
- "payload": [
3917
- {
3918
- "name": "data",
3919
- "type": "object",
3920
- "required": true
3921
- }
3922
- ]
3923
- },
3924
- {
3925
- "key": "CONFIRM_DELETE",
3926
- "name": "Confirm Delete"
3927
- },
3928
- {
3929
- "key": "CANCEL",
3930
- "name": "Cancel"
3931
2778
  },
3932
2779
  {
3933
- "key": "CLOSE",
3934
- "name": "Close"
3935
- }
3936
- ],
3937
- "transitions": [
3938
- {
3939
- "from": "browsing",
3940
- "to": "browsing",
3941
- "event": "INIT",
2780
+ "from": "step3",
2781
+ "to": "step2",
2782
+ "event": "PREV",
3942
2783
  "effects": [
3943
2784
  [
3944
- "ref",
3945
- "OrderRecord"
2785
+ "fetch",
2786
+ "Checkout"
3946
2787
  ],
3947
2788
  [
3948
2789
  "render-ui",
@@ -3974,17 +2815,14 @@
3974
2815
  ],
3975
2816
  "children": [
3976
2817
  {
3977
- "type": "stack",
3978
- "direction": "vertical",
3979
- "gap": "lg",
3980
- "className": "max-w-5xl mx-auto w-full",
2818
+ "type": "container",
2819
+ "maxWidth": "lg",
2820
+ "padding": "lg",
3981
2821
  "children": [
3982
2822
  {
3983
2823
  "type": "stack",
3984
- "direction": "horizontal",
3985
- "gap": "md",
3986
- "justify": "space-between",
3987
- "align": "center",
2824
+ "direction": "vertical",
2825
+ "gap": "lg",
3988
2826
  "children": [
3989
2827
  {
3990
2828
  "type": "stack",
@@ -3994,90 +2832,200 @@
3994
2832
  "children": [
3995
2833
  {
3996
2834
  "type": "icon",
3997
- "name": "clipboard-list",
2835
+ "name": "credit-card",
3998
2836
  "size": "lg"
3999
2837
  },
4000
2838
  {
4001
2839
  "type": "typography",
4002
- "content": "Order History",
2840
+ "content": "Checkout",
4003
2841
  "variant": "h2"
4004
2842
  }
4005
2843
  ]
4006
2844
  },
2845
+ {
2846
+ "type": "progress-dots",
2847
+ "count": 3,
2848
+ "currentIndex": 1
2849
+ },
2850
+ {
2851
+ "type": "wizard-progress",
2852
+ "steps": [
2853
+ "Customer Info",
2854
+ "Shipping",
2855
+ "Payment"
2856
+ ],
2857
+ "currentStep": 1
2858
+ },
2859
+ {
2860
+ "type": "divider"
2861
+ },
2862
+ {
2863
+ "type": "typography",
2864
+ "content": "Shipping",
2865
+ "variant": "h3"
2866
+ },
2867
+ {
2868
+ "type": "form-section",
2869
+ "entity": "Checkout",
2870
+ "mode": "create",
2871
+ "submitEvent": "NEXT",
2872
+ "cancelEvent": "PREV",
2873
+ "fields": [
2874
+ "shippingAddress"
2875
+ ]
2876
+ },
4007
2877
  {
4008
2878
  "type": "stack",
4009
2879
  "direction": "horizontal",
4010
2880
  "gap": "sm",
2881
+ "justify": "end",
4011
2882
  "children": [
4012
2883
  {
4013
2884
  "type": "button",
4014
- "label": "Create OrderRecord",
4015
- "event": "CREATE",
2885
+ "label": "Back",
2886
+ "event": "PREV",
2887
+ "variant": "ghost",
2888
+ "icon": "arrow-left"
2889
+ },
2890
+ {
2891
+ "type": "button",
2892
+ "label": "Next",
2893
+ "event": "NEXT",
4016
2894
  "variant": "primary",
4017
- "icon": "plus"
2895
+ "icon": "arrow-right"
4018
2896
  }
4019
2897
  ]
4020
2898
  }
4021
2899
  ]
4022
- },
4023
- {
4024
- "type": "divider"
4025
- },
2900
+ }
2901
+ ]
2902
+ }
2903
+ ]
2904
+ }
2905
+ ]
2906
+ ]
2907
+ },
2908
+ {
2909
+ "from": "review",
2910
+ "to": "step3",
2911
+ "event": "PREV",
2912
+ "effects": [
2913
+ [
2914
+ "fetch",
2915
+ "Checkout"
2916
+ ],
2917
+ [
2918
+ "render-ui",
2919
+ "main",
2920
+ {
2921
+ "type": "dashboard-layout",
2922
+ "appName": "EcommerceApp",
2923
+ "navItems": [
2924
+ {
2925
+ "label": "Products",
2926
+ "href": "/products",
2927
+ "icon": "package"
2928
+ },
2929
+ {
2930
+ "label": "Cart",
2931
+ "href": "/cart",
2932
+ "icon": "shopping-cart"
2933
+ },
2934
+ {
2935
+ "label": "Checkout",
2936
+ "href": "/checkout",
2937
+ "icon": "credit-card"
2938
+ },
2939
+ {
2940
+ "label": "Orders",
2941
+ "href": "/orders",
2942
+ "icon": "clipboard-list"
2943
+ }
2944
+ ],
2945
+ "children": [
2946
+ {
2947
+ "type": "container",
2948
+ "maxWidth": "lg",
2949
+ "padding": "lg",
2950
+ "children": [
4026
2951
  {
4027
- "type": "data-list",
4028
- "entity": "OrderRecord",
4029
- "emptyIcon": "inbox",
4030
- "emptyTitle": "No orders yet",
4031
- "emptyDescription": "Orders will appear here as customers complete checkout.",
4032
- "itemActions": [
2952
+ "type": "stack",
2953
+ "direction": "vertical",
2954
+ "gap": "lg",
2955
+ "children": [
4033
2956
  {
4034
- "label": "View",
4035
- "event": "VIEW",
4036
- "variant": "ghost",
4037
- "size": "sm"
2957
+ "type": "stack",
2958
+ "direction": "horizontal",
2959
+ "gap": "sm",
2960
+ "align": "center",
2961
+ "children": [
2962
+ {
2963
+ "type": "icon",
2964
+ "name": "credit-card",
2965
+ "size": "lg"
2966
+ },
2967
+ {
2968
+ "type": "typography",
2969
+ "content": "Checkout",
2970
+ "variant": "h2"
2971
+ }
2972
+ ]
4038
2973
  },
4039
2974
  {
4040
- "label": "Edit",
4041
- "event": "EDIT",
4042
- "variant": "ghost",
4043
- "size": "sm"
2975
+ "type": "progress-dots",
2976
+ "count": 3,
2977
+ "currentIndex": 2
4044
2978
  },
4045
2979
  {
4046
- "label": "Delete",
4047
- "event": "DELETE",
4048
- "variant": "danger",
4049
- "size": "sm"
4050
- }
4051
- ],
4052
- "columns": [
4053
- {
4054
- "name": "customerName",
4055
- "label": "Customer",
4056
- "variant": "h3",
4057
- "icon": "clipboard-list"
2980
+ "type": "wizard-progress",
2981
+ "steps": [
2982
+ "Customer Info",
2983
+ "Shipping",
2984
+ "Payment"
2985
+ ],
2986
+ "currentStep": 2
4058
2987
  },
4059
2988
  {
4060
- "name": "status",
4061
- "variant": "badge"
2989
+ "type": "divider"
4062
2990
  },
4063
2991
  {
4064
- "name": "orderTotal",
4065
- "label": "Total",
4066
- "variant": "h4",
4067
- "format": "currency"
2992
+ "type": "typography",
2993
+ "content": "Payment",
2994
+ "variant": "h3"
4068
2995
  },
4069
2996
  {
4070
- "name": "email",
4071
- "variant": "caption"
2997
+ "type": "form-section",
2998
+ "entity": "Checkout",
2999
+ "mode": "create",
3000
+ "submitEvent": "NEXT",
3001
+ "cancelEvent": "PREV",
3002
+ "fields": [
3003
+ "paymentMethod"
3004
+ ]
4072
3005
  },
4073
3006
  {
4074
- "name": "shippingAddress",
4075
- "label": "Address",
4076
- "variant": "caption"
3007
+ "type": "stack",
3008
+ "direction": "horizontal",
3009
+ "gap": "sm",
3010
+ "justify": "end",
3011
+ "children": [
3012
+ {
3013
+ "type": "button",
3014
+ "label": "Back",
3015
+ "event": "PREV",
3016
+ "variant": "ghost",
3017
+ "icon": "arrow-left"
3018
+ },
3019
+ {
3020
+ "type": "button",
3021
+ "label": "Next",
3022
+ "event": "NEXT",
3023
+ "variant": "primary",
3024
+ "icon": "arrow-right"
3025
+ }
3026
+ ]
4077
3027
  }
4078
- ],
4079
- "variant": "card",
4080
- "gap": "sm"
3028
+ ]
4081
3029
  }
4082
3030
  ]
4083
3031
  }
@@ -4087,95 +3035,77 @@
4087
3035
  ]
4088
3036
  },
4089
3037
  {
4090
- "from": "browsing",
4091
- "to": "browsing",
4092
- "event": "ORDER_RECORD_CREATED",
4093
- "effects": [
4094
- [
4095
- "ref",
4096
- "OrderRecord"
4097
- ]
4098
- ]
4099
- },
4100
- {
4101
- "from": "browsing",
4102
- "to": "browsing",
4103
- "event": "ORDER_RECORD_UPDATED",
3038
+ "from": "review",
3039
+ "to": "complete",
3040
+ "event": "COMPLETE",
4104
3041
  "effects": [
4105
3042
  [
4106
- "ref",
4107
- "OrderRecord"
4108
- ]
4109
- ]
4110
- },
4111
- {
4112
- "from": "browsing",
4113
- "to": "deleting",
4114
- "event": "DELETE",
4115
- "effects": [
3043
+ "persist",
3044
+ "create",
3045
+ "Checkout",
3046
+ "@payload.data"
3047
+ ],
4116
3048
  [
4117
- "fetch",
4118
- "OrderRecord",
4119
- {
4120
- "id": "@payload.id"
4121
- }
3049
+ "notify",
3050
+ "success",
3051
+ "Checkout created successfully"
4122
3052
  ],
4123
3053
  [
4124
3054
  "render-ui",
4125
- "modal",
3055
+ "main",
4126
3056
  {
4127
- "type": "stack",
4128
- "direction": "vertical",
4129
- "gap": "md",
4130
- "children": [
3057
+ "type": "dashboard-layout",
3058
+ "appName": "EcommerceApp",
3059
+ "navItems": [
4131
3060
  {
4132
- "type": "stack",
4133
- "direction": "horizontal",
4134
- "gap": "sm",
4135
- "children": [
4136
- {
4137
- "type": "icon",
4138
- "name": "trash-2",
4139
- "size": "md"
4140
- },
4141
- {
4142
- "type": "typography",
4143
- "content": "Delete OrderRecord",
4144
- "variant": "h3"
4145
- }
4146
- ]
3061
+ "label": "Products",
3062
+ "href": "/products",
3063
+ "icon": "package"
4147
3064
  },
4148
3065
  {
4149
- "type": "divider"
3066
+ "label": "Cart",
3067
+ "href": "/cart",
3068
+ "icon": "shopping-cart"
4150
3069
  },
4151
3070
  {
4152
- "type": "typography",
4153
- "content": "@entity.customerName",
4154
- "variant": "h4"
3071
+ "label": "Checkout",
3072
+ "href": "/checkout",
3073
+ "icon": "credit-card"
4155
3074
  },
4156
3075
  {
4157
- "type": "typography",
4158
- "content": "This action cannot be undone.",
4159
- "variant": "body"
4160
- },
3076
+ "label": "Orders",
3077
+ "href": "/orders",
3078
+ "icon": "clipboard-list"
3079
+ }
3080
+ ],
3081
+ "children": [
4161
3082
  {
4162
3083
  "type": "stack",
4163
- "direction": "horizontal",
4164
- "gap": "sm",
4165
- "justify": "end",
3084
+ "direction": "vertical",
3085
+ "gap": "lg",
3086
+ "align": "center",
4166
3087
  "children": [
4167
3088
  {
4168
- "type": "button",
4169
- "label": "Cancel",
4170
- "event": "CANCEL",
4171
- "variant": "ghost"
3089
+ "type": "icon",
3090
+ "name": "check-circle",
3091
+ "size": "lg"
3092
+ },
3093
+ {
3094
+ "type": "typography",
3095
+ "content": "Order Placed",
3096
+ "variant": "h2"
3097
+ },
3098
+ {
3099
+ "type": "typography",
3100
+ "content": "Your order has been placed successfully.",
3101
+ "variant": "body"
4172
3102
  },
4173
3103
  {
4174
3104
  "type": "button",
4175
- "label": "Delete",
4176
- "event": "CONFIRM_DELETE",
4177
- "variant": "danger",
4178
- "icon": "trash"
3105
+ "label": "Start New",
3106
+ "event": "RESTART",
3107
+ "variant": "primary",
3108
+ "icon": "refresh-cw"
4179
3109
  }
4180
3110
  ]
4181
3111
  }
@@ -4185,20 +3115,13 @@
4185
3115
  ]
4186
3116
  },
4187
3117
  {
4188
- "from": "deleting",
4189
- "to": "browsing",
4190
- "event": "CONFIRM_DELETE",
3118
+ "from": "complete",
3119
+ "to": "step1",
3120
+ "event": "RESTART",
4191
3121
  "effects": [
4192
3122
  [
4193
- "persist",
4194
- "delete",
4195
- "OrderRecord",
4196
- "@entity.id"
4197
- ],
4198
- [
4199
- "render-ui",
4200
- "modal",
4201
- null
3123
+ "fetch",
3124
+ "Checkout"
4202
3125
  ],
4203
3126
  [
4204
3127
  "render-ui",
@@ -4230,17 +3153,14 @@
4230
3153
  ],
4231
3154
  "children": [
4232
3155
  {
4233
- "type": "stack",
4234
- "direction": "vertical",
4235
- "gap": "lg",
4236
- "className": "max-w-5xl mx-auto w-full",
3156
+ "type": "container",
3157
+ "maxWidth": "lg",
3158
+ "padding": "lg",
4237
3159
  "children": [
4238
3160
  {
4239
3161
  "type": "stack",
4240
- "direction": "horizontal",
4241
- "gap": "md",
4242
- "justify": "space-between",
4243
- "align": "center",
3162
+ "direction": "vertical",
3163
+ "gap": "lg",
4244
3164
  "children": [
4245
3165
  {
4246
3166
  "type": "stack",
@@ -4250,115 +3170,81 @@
4250
3170
  "children": [
4251
3171
  {
4252
3172
  "type": "icon",
4253
- "name": "clipboard-list",
3173
+ "name": "credit-card",
4254
3174
  "size": "lg"
4255
3175
  },
4256
3176
  {
4257
3177
  "type": "typography",
4258
- "content": "Order History",
3178
+ "content": "Checkout",
4259
3179
  "variant": "h2"
4260
3180
  }
4261
3181
  ]
4262
3182
  },
4263
3183
  {
4264
- "type": "stack",
4265
- "direction": "horizontal",
4266
- "gap": "sm",
4267
- "children": [
4268
- {
4269
- "type": "button",
4270
- "label": "Create OrderRecord",
4271
- "event": "CREATE",
4272
- "variant": "primary",
4273
- "icon": "plus"
4274
- }
4275
- ]
4276
- }
4277
- ]
4278
- },
4279
- {
4280
- "type": "divider"
4281
- },
4282
- {
4283
- "type": "data-list",
4284
- "entity": "OrderRecord",
4285
- "emptyIcon": "inbox",
4286
- "emptyTitle": "No orders yet",
4287
- "emptyDescription": "Orders will appear here as customers complete checkout.",
4288
- "itemActions": [
4289
- {
4290
- "label": "View",
4291
- "event": "VIEW",
4292
- "variant": "ghost",
4293
- "size": "sm"
4294
- },
4295
- {
4296
- "label": "Edit",
4297
- "event": "EDIT",
4298
- "variant": "ghost",
4299
- "size": "sm"
3184
+ "type": "progress-dots",
3185
+ "count": 3,
3186
+ "currentIndex": 0
4300
3187
  },
4301
3188
  {
4302
- "label": "Delete",
4303
- "event": "DELETE",
4304
- "variant": "danger",
4305
- "size": "sm"
4306
- }
4307
- ],
4308
- "columns": [
4309
- {
4310
- "name": "customerName",
4311
- "label": "Customer",
4312
- "variant": "h3",
4313
- "icon": "clipboard-list"
3189
+ "type": "wizard-progress",
3190
+ "steps": [
3191
+ "Customer Info",
3192
+ "Shipping",
3193
+ "Payment"
3194
+ ],
3195
+ "currentStep": 0
4314
3196
  },
4315
3197
  {
4316
- "name": "status",
4317
- "variant": "badge"
3198
+ "type": "divider"
4318
3199
  },
4319
3200
  {
4320
- "name": "orderTotal",
4321
- "label": "Total",
4322
- "variant": "h4",
4323
- "format": "currency"
3201
+ "type": "typography",
3202
+ "content": "Customer Info",
3203
+ "variant": "h3"
4324
3204
  },
4325
3205
  {
4326
- "name": "email",
4327
- "variant": "caption"
3206
+ "type": "form-section",
3207
+ "entity": "Checkout",
3208
+ "mode": "create",
3209
+ "submitEvent": "NEXT",
3210
+ "cancelEvent": "INIT",
3211
+ "fields": [
3212
+ "customerName",
3213
+ "email"
3214
+ ]
4328
3215
  },
4329
3216
  {
4330
- "name": "shippingAddress",
4331
- "label": "Address",
4332
- "variant": "caption"
3217
+ "type": "stack",
3218
+ "direction": "horizontal",
3219
+ "gap": "sm",
3220
+ "justify": "end",
3221
+ "children": [
3222
+ {
3223
+ "type": "button",
3224
+ "label": "Next",
3225
+ "event": "NEXT",
3226
+ "variant": "primary",
3227
+ "icon": "arrow-right"
3228
+ }
3229
+ ]
4333
3230
  }
4334
- ],
4335
- "variant": "card",
4336
- "gap": "sm"
3231
+ ]
4337
3232
  }
4338
3233
  ]
4339
3234
  }
4340
3235
  ]
4341
3236
  }
4342
- ],
4343
- [
4344
- "notify",
4345
- "OrderRecord deleted successfully"
4346
3237
  ]
4347
3238
  ]
4348
3239
  },
4349
3240
  {
4350
- "from": "deleting",
4351
- "to": "browsing",
4352
- "event": "CANCEL",
3241
+ "from": "complete",
3242
+ "to": "step1",
3243
+ "event": "INIT",
4353
3244
  "effects": [
4354
- [
4355
- "render-ui",
4356
- "modal",
4357
- null
4358
- ],
4359
3245
  [
4360
3246
  "fetch",
4361
- "OrderRecord"
3247
+ "Checkout"
4362
3248
  ],
4363
3249
  [
4364
3250
  "render-ui",
@@ -4390,17 +3276,14 @@
4390
3276
  ],
4391
3277
  "children": [
4392
3278
  {
4393
- "type": "stack",
4394
- "direction": "vertical",
4395
- "gap": "lg",
4396
- "className": "max-w-5xl mx-auto w-full",
3279
+ "type": "container",
3280
+ "maxWidth": "lg",
3281
+ "padding": "lg",
4397
3282
  "children": [
4398
3283
  {
4399
3284
  "type": "stack",
4400
- "direction": "horizontal",
4401
- "gap": "md",
4402
- "justify": "space-between",
4403
- "align": "center",
3285
+ "direction": "vertical",
3286
+ "gap": "lg",
4404
3287
  "children": [
4405
3288
  {
4406
3289
  "type": "stack",
@@ -4410,90 +3293,65 @@
4410
3293
  "children": [
4411
3294
  {
4412
3295
  "type": "icon",
4413
- "name": "clipboard-list",
4414
- "size": "lg"
4415
- },
4416
- {
4417
- "type": "typography",
4418
- "content": "Order History",
4419
- "variant": "h2"
4420
- }
4421
- ]
4422
- },
4423
- {
4424
- "type": "stack",
4425
- "direction": "horizontal",
4426
- "gap": "sm",
4427
- "children": [
3296
+ "name": "credit-card",
3297
+ "size": "lg"
3298
+ },
4428
3299
  {
4429
- "type": "button",
4430
- "label": "Create OrderRecord",
4431
- "event": "CREATE",
4432
- "variant": "primary",
4433
- "icon": "plus"
3300
+ "type": "typography",
3301
+ "content": "Checkout",
3302
+ "variant": "h2"
4434
3303
  }
4435
3304
  ]
4436
- }
4437
- ]
4438
- },
4439
- {
4440
- "type": "divider"
4441
- },
4442
- {
4443
- "type": "data-list",
4444
- "entity": "OrderRecord",
4445
- "emptyIcon": "inbox",
4446
- "emptyTitle": "No orders yet",
4447
- "emptyDescription": "Orders will appear here as customers complete checkout.",
4448
- "itemActions": [
4449
- {
4450
- "label": "View",
4451
- "event": "VIEW",
4452
- "variant": "ghost",
4453
- "size": "sm"
4454
3305
  },
4455
3306
  {
4456
- "label": "Edit",
4457
- "event": "EDIT",
4458
- "variant": "ghost",
4459
- "size": "sm"
3307
+ "type": "progress-dots",
3308
+ "count": 3,
3309
+ "currentIndex": 0
4460
3310
  },
4461
3311
  {
4462
- "label": "Delete",
4463
- "event": "DELETE",
4464
- "variant": "danger",
4465
- "size": "sm"
4466
- }
4467
- ],
4468
- "columns": [
4469
- {
4470
- "name": "customerName",
4471
- "label": "Customer",
4472
- "variant": "h3",
4473
- "icon": "clipboard-list"
3312
+ "type": "wizard-progress",
3313
+ "steps": [
3314
+ "Customer Info",
3315
+ "Shipping",
3316
+ "Payment"
3317
+ ],
3318
+ "currentStep": 0
4474
3319
  },
4475
3320
  {
4476
- "name": "status",
4477
- "variant": "badge"
3321
+ "type": "divider"
4478
3322
  },
4479
3323
  {
4480
- "name": "orderTotal",
4481
- "label": "Total",
4482
- "variant": "h4",
4483
- "format": "currency"
3324
+ "type": "typography",
3325
+ "content": "Customer Info",
3326
+ "variant": "h3"
4484
3327
  },
4485
3328
  {
4486
- "name": "email",
4487
- "variant": "caption"
3329
+ "type": "form-section",
3330
+ "entity": "Checkout",
3331
+ "mode": "create",
3332
+ "submitEvent": "NEXT",
3333
+ "cancelEvent": "INIT",
3334
+ "fields": [
3335
+ "customerName",
3336
+ "email"
3337
+ ]
4488
3338
  },
4489
3339
  {
4490
- "name": "shippingAddress",
4491
- "label": "Address",
4492
- "variant": "caption"
3340
+ "type": "stack",
3341
+ "direction": "horizontal",
3342
+ "gap": "sm",
3343
+ "justify": "end",
3344
+ "children": [
3345
+ {
3346
+ "type": "button",
3347
+ "label": "Next",
3348
+ "event": "NEXT",
3349
+ "variant": "primary",
3350
+ "icon": "arrow-right"
3351
+ }
3352
+ ]
4493
3353
  }
4494
- ],
4495
- "variant": "card",
4496
- "gap": "sm"
3354
+ ]
4497
3355
  }
4498
3356
  ]
4499
3357
  }
@@ -4501,19 +3359,187 @@
4501
3359
  }
4502
3360
  ]
4503
3361
  ]
4504
- },
3362
+ }
3363
+ ]
3364
+ },
3365
+ "listens": [
3366
+ {
3367
+ "event": "CHECKOUT_STARTED",
3368
+ "triggers": "INIT",
3369
+ "scope": "external"
3370
+ }
3371
+ ],
3372
+ "emits": [
3373
+ {
3374
+ "event": "ORDER_PLACED",
3375
+ "payload": [
3376
+ {
3377
+ "name": "id",
3378
+ "type": "string",
3379
+ "required": true
3380
+ }
3381
+ ],
3382
+ "scope": "external"
3383
+ }
3384
+ ]
3385
+ }
3386
+ ],
3387
+ "pages": [
3388
+ {
3389
+ "name": "CheckoutPage",
3390
+ "path": "/checkout",
3391
+ "traits": [
3392
+ {
3393
+ "ref": "CheckoutWizard"
3394
+ }
3395
+ ]
3396
+ }
3397
+ ]
3398
+ },
3399
+ {
3400
+ "name": "OrderRecordOrbital",
3401
+ "entity": {
3402
+ "name": "OrderRecord",
3403
+ "persistence": "persistent",
3404
+ "collection": "orderrecords",
3405
+ "fields": [
3406
+ {
3407
+ "name": "id",
3408
+ "type": "string",
3409
+ "required": true
3410
+ },
3411
+ {
3412
+ "name": "customerName",
3413
+ "type": "string",
3414
+ "required": true
3415
+ },
3416
+ {
3417
+ "name": "email",
3418
+ "type": "string",
3419
+ "required": true
3420
+ },
3421
+ {
3422
+ "name": "shippingAddress",
3423
+ "type": "string",
3424
+ "required": true
3425
+ },
3426
+ {
3427
+ "name": "paymentMethod",
3428
+ "type": "string",
3429
+ "required": true
3430
+ },
3431
+ {
3432
+ "name": "orderTotal",
3433
+ "type": "number"
3434
+ },
3435
+ {
3436
+ "name": "status",
3437
+ "type": "string",
3438
+ "default": "pending",
3439
+ "values": [
3440
+ "pending",
3441
+ "processing",
3442
+ "shipped",
3443
+ "delivered",
3444
+ "cancelled"
3445
+ ]
3446
+ }
3447
+ ]
3448
+ },
3449
+ "traits": [
3450
+ {
3451
+ "name": "OrderRecordBrowse",
3452
+ "linkedEntity": "OrderRecord",
3453
+ "category": "interaction",
3454
+ "listens": [
3455
+ {
3456
+ "event": "ORDER_RECORD_CREATED",
3457
+ "triggers": "INIT"
3458
+ },
3459
+ {
3460
+ "event": "ORDER_RECORD_UPDATED",
3461
+ "triggers": "INIT"
3462
+ },
3463
+ {
3464
+ "event": "ORDER_RECORD_DELETED",
3465
+ "triggers": "INIT"
3466
+ },
3467
+ {
3468
+ "event": "ORDER_PLACED",
3469
+ "triggers": "INIT",
3470
+ "scope": "external"
3471
+ }
3472
+ ],
3473
+ "stateMachine": {
3474
+ "states": [
3475
+ {
3476
+ "name": "browsing",
3477
+ "isInitial": true
3478
+ }
3479
+ ],
3480
+ "events": [
3481
+ {
3482
+ "key": "INIT",
3483
+ "name": "Initialize"
3484
+ },
3485
+ {
3486
+ "key": "CREATE",
3487
+ "name": "CREATE"
3488
+ },
3489
+ {
3490
+ "key": "VIEW",
3491
+ "name": "VIEW",
3492
+ "payload": [
3493
+ {
3494
+ "name": "id",
3495
+ "type": "string",
3496
+ "required": true
3497
+ },
3498
+ {
3499
+ "name": "row",
3500
+ "type": "object"
3501
+ }
3502
+ ]
3503
+ },
3504
+ {
3505
+ "key": "EDIT",
3506
+ "name": "EDIT",
3507
+ "payload": [
3508
+ {
3509
+ "name": "id",
3510
+ "type": "string",
3511
+ "required": true
3512
+ },
3513
+ {
3514
+ "name": "row",
3515
+ "type": "object"
3516
+ }
3517
+ ]
3518
+ },
3519
+ {
3520
+ "key": "DELETE",
3521
+ "name": "DELETE",
3522
+ "payload": [
3523
+ {
3524
+ "name": "id",
3525
+ "type": "string",
3526
+ "required": true
3527
+ },
3528
+ {
3529
+ "name": "row",
3530
+ "type": "object"
3531
+ }
3532
+ ]
3533
+ }
3534
+ ],
3535
+ "transitions": [
4505
3536
  {
4506
- "from": "deleting",
3537
+ "from": "browsing",
4507
3538
  "to": "browsing",
4508
- "event": "CLOSE",
3539
+ "event": "INIT",
4509
3540
  "effects": [
4510
3541
  [
4511
- "render-ui",
4512
- "modal",
4513
- null
4514
- ],
4515
- [
4516
- "fetch",
3542
+ "ref",
4517
3543
  "OrderRecord"
4518
3544
  ],
4519
3545
  [
@@ -4666,6 +3692,9 @@
4666
3692
  "linkedEntity": "OrderRecord",
4667
3693
  "category": "interaction",
4668
3694
  "emits": [
3695
+ {
3696
+ "event": "SAVE"
3697
+ },
4669
3698
  {
4670
3699
  "event": "ORDER_RECORD_CREATED"
4671
3700
  }
@@ -4810,10 +3839,6 @@
4810
3839
  [
4811
3840
  "emit",
4812
3841
  "ORDER_RECORD_CREATED"
4813
- ],
4814
- [
4815
- "notify",
4816
- "OrderRecord created successfully"
4817
3842
  ]
4818
3843
  ]
4819
3844
  }
@@ -4825,6 +3850,9 @@
4825
3850
  "linkedEntity": "OrderRecord",
4826
3851
  "category": "interaction",
4827
3852
  "emits": [
3853
+ {
3854
+ "event": "SAVE"
3855
+ },
4828
3856
  {
4829
3857
  "event": "ORDER_RECORD_UPDATED"
4830
3858
  }
@@ -4980,10 +4008,6 @@
4980
4008
  [
4981
4009
  "emit",
4982
4010
  "ORDER_RECORD_UPDATED"
4983
- ],
4984
- [
4985
- "notify",
4986
- "OrderRecord updated successfully"
4987
4011
  ]
4988
4012
  ]
4989
4013
  }
@@ -4994,6 +4018,11 @@
4994
4018
  "name": "OrderRecordView",
4995
4019
  "linkedEntity": "OrderRecord",
4996
4020
  "category": "interaction",
4021
+ "emits": [
4022
+ {
4023
+ "event": "SAVE"
4024
+ }
4025
+ ],
4997
4026
  "stateMachine": {
4998
4027
  "states": [
4999
4028
  {
@@ -5023,6 +4052,17 @@
5023
4052
  {
5024
4053
  "key": "CLOSE",
5025
4054
  "name": "Close"
4055
+ },
4056
+ {
4057
+ "key": "SAVE",
4058
+ "name": "Save",
4059
+ "payload": [
4060
+ {
4061
+ "name": "data",
4062
+ "type": "object",
4063
+ "required": true
4064
+ }
4065
+ ]
5026
4066
  }
5027
4067
  ],
5028
4068
  "transitions": [
@@ -5225,6 +4265,219 @@
5225
4265
  "info"
5226
4266
  ]
5227
4267
  ]
4268
+ },
4269
+ {
4270
+ "from": "open",
4271
+ "to": "closed",
4272
+ "event": "SAVE",
4273
+ "effects": [
4274
+ [
4275
+ "render-ui",
4276
+ "modal",
4277
+ null
4278
+ ]
4279
+ ]
4280
+ }
4281
+ ]
4282
+ }
4283
+ },
4284
+ {
4285
+ "name": "OrderRecordDelete",
4286
+ "linkedEntity": "OrderRecord",
4287
+ "category": "interaction",
4288
+ "emits": [
4289
+ {
4290
+ "event": "CONFIRM_DELETE"
4291
+ },
4292
+ {
4293
+ "event": "ORDER_RECORD_DELETED"
4294
+ }
4295
+ ],
4296
+ "stateMachine": {
4297
+ "states": [
4298
+ {
4299
+ "name": "idle",
4300
+ "isInitial": true
4301
+ },
4302
+ {
4303
+ "name": "confirming"
4304
+ }
4305
+ ],
4306
+ "events": [
4307
+ {
4308
+ "key": "INIT",
4309
+ "name": "Initialize"
4310
+ },
4311
+ {
4312
+ "key": "DELETE",
4313
+ "name": "Request Confirmation",
4314
+ "payload": [
4315
+ {
4316
+ "name": "id",
4317
+ "type": "string",
4318
+ "required": true
4319
+ }
4320
+ ]
4321
+ },
4322
+ {
4323
+ "key": "CONFIRM_DELETE",
4324
+ "name": "Confirm"
4325
+ },
4326
+ {
4327
+ "key": "CANCEL",
4328
+ "name": "Cancel"
4329
+ },
4330
+ {
4331
+ "key": "CLOSE",
4332
+ "name": "Close"
4333
+ }
4334
+ ],
4335
+ "transitions": [
4336
+ {
4337
+ "from": "idle",
4338
+ "to": "idle",
4339
+ "event": "INIT",
4340
+ "effects": [
4341
+ [
4342
+ "ref",
4343
+ "OrderRecord"
4344
+ ]
4345
+ ]
4346
+ },
4347
+ {
4348
+ "from": "idle",
4349
+ "to": "confirming",
4350
+ "event": "DELETE",
4351
+ "effects": [
4352
+ [
4353
+ "set",
4354
+ "@entity.pendingId",
4355
+ "@payload.id"
4356
+ ],
4357
+ [
4358
+ "fetch",
4359
+ "OrderRecord",
4360
+ {
4361
+ "id": "@payload.id"
4362
+ }
4363
+ ],
4364
+ [
4365
+ "render-ui",
4366
+ "modal",
4367
+ {
4368
+ "type": "stack",
4369
+ "direction": "vertical",
4370
+ "gap": "md",
4371
+ "children": [
4372
+ {
4373
+ "type": "stack",
4374
+ "direction": "horizontal",
4375
+ "gap": "sm",
4376
+ "align": "center",
4377
+ "children": [
4378
+ {
4379
+ "type": "icon",
4380
+ "name": "alert-triangle",
4381
+ "size": "md"
4382
+ },
4383
+ {
4384
+ "type": "typography",
4385
+ "content": "Delete OrderRecord",
4386
+ "variant": "h3"
4387
+ }
4388
+ ]
4389
+ },
4390
+ {
4391
+ "type": "divider"
4392
+ },
4393
+ {
4394
+ "type": "alert",
4395
+ "variant": "danger",
4396
+ "message": "This action cannot be undone."
4397
+ },
4398
+ {
4399
+ "type": "stack",
4400
+ "direction": "horizontal",
4401
+ "gap": "sm",
4402
+ "justify": "end",
4403
+ "children": [
4404
+ {
4405
+ "type": "button",
4406
+ "label": "Cancel",
4407
+ "event": "CANCEL",
4408
+ "variant": "ghost"
4409
+ },
4410
+ {
4411
+ "type": "button",
4412
+ "label": "Delete",
4413
+ "event": "CONFIRM_DELETE",
4414
+ "variant": "danger",
4415
+ "icon": "check"
4416
+ }
4417
+ ]
4418
+ }
4419
+ ]
4420
+ }
4421
+ ]
4422
+ ]
4423
+ },
4424
+ {
4425
+ "from": "confirming",
4426
+ "to": "idle",
4427
+ "event": "CONFIRM_DELETE",
4428
+ "effects": [
4429
+ [
4430
+ "persist",
4431
+ "delete",
4432
+ "OrderRecord",
4433
+ "@entity.pendingId"
4434
+ ],
4435
+ [
4436
+ "render-ui",
4437
+ "modal",
4438
+ null
4439
+ ],
4440
+ [
4441
+ "ref",
4442
+ "OrderRecord"
4443
+ ],
4444
+ [
4445
+ "emit",
4446
+ "ORDER_RECORD_DELETED"
4447
+ ]
4448
+ ]
4449
+ },
4450
+ {
4451
+ "from": "confirming",
4452
+ "to": "idle",
4453
+ "event": "CANCEL",
4454
+ "effects": [
4455
+ [
4456
+ "render-ui",
4457
+ "modal",
4458
+ null
4459
+ ],
4460
+ [
4461
+ "ref",
4462
+ "OrderRecord"
4463
+ ]
4464
+ ]
4465
+ },
4466
+ {
4467
+ "from": "confirming",
4468
+ "to": "idle",
4469
+ "event": "CLOSE",
4470
+ "effects": [
4471
+ [
4472
+ "render-ui",
4473
+ "modal",
4474
+ null
4475
+ ],
4476
+ [
4477
+ "ref",
4478
+ "OrderRecord"
4479
+ ]
4480
+ ]
5228
4481
  }
5229
4482
  ]
5230
4483
  }
@@ -5246,11 +4499,13 @@
5246
4499
  },
5247
4500
  {
5248
4501
  "ref": "OrderRecordView"
4502
+ },
4503
+ {
4504
+ "ref": "OrderRecordDelete"
5249
4505
  }
5250
4506
  ]
5251
4507
  }
5252
4508
  ]
5253
4509
  }
5254
- ],
5255
- "description": "E-commerce organism. Composes molecules via compose: - stdList(Product): product catalog with CRUD - stdCart(CartItem): shopping cart with add/remove - stdWizard(Checkout): checkout wizard - stdList(OrderRecord): order history Cross-orbital connections: - ADD_TO_CART: ProductBrowse -> CartItemCartBrowse - CHECKOUT_STARTED: CartItemCartBrowse -> CheckoutWizard - ORDER_PLACED: CheckoutWizard -> OrderRecordBrowse"
5256
- }
4510
+ ]
4511
+ }