@almadar/std 14.8.0 → 14.9.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 (57) hide show
  1. package/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  2. package/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  3. package/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  4. package/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  5. package/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  6. package/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  7. package/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  8. package/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  9. package/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  10. package/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  11. package/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  12. package/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  13. package/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  14. package/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  15. package/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  16. package/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  17. package/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  18. package/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  19. package/behaviors/registry/core/atoms/std-stats.orb +131 -110
  20. package/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  21. package/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  22. package/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  23. package/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  24. package/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  25. package/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  26. package/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  27. package/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  28. package/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  29. package/dist/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  30. package/dist/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  31. package/dist/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  32. package/dist/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  33. package/dist/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  34. package/dist/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  35. package/dist/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  36. package/dist/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  37. package/dist/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  38. package/dist/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  39. package/dist/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  40. package/dist/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  41. package/dist/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  42. package/dist/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  43. package/dist/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  44. package/dist/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  45. package/dist/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  46. package/dist/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  47. package/dist/behaviors/registry/core/atoms/std-stats.orb +131 -110
  48. package/dist/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  49. package/dist/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  50. package/dist/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  51. package/dist/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  52. package/dist/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  53. package/dist/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  54. package/dist/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  55. package/dist/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  56. package/dist/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  57. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-service-youtube",
3
- "version": "1.0.0",
4
- "description": "std-service-youtube as a Function",
3
+ "version": "2.0.0",
4
+ "description": "std-service-youtube. YouTube embed service. Bind via `uses Youtube from \"std/behaviors/std-service-youtube\"` and configure `videoId` / `autoplay` / `controls` / `start` at the call site. SPECIAL: the default render IS the embed itself, so passing `uiTrait: \"@trait.YourPlayerSkin\"` OVERRIDES the embed (e.g., a custom player skin) rather than supplements it. Leave `uiTrait` unset to render the atom's default embed.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "ServiceYoutubeOrbital",
@@ -15,29 +15,24 @@
15
15
  "required": true
16
16
  },
17
17
  {
18
- "name": "query",
18
+ "name": "videoId",
19
19
  "type": "string",
20
20
  "default": ""
21
21
  },
22
22
  {
23
- "name": "selectedVideoId",
24
- "type": "string",
25
- "default": ""
23
+ "name": "autoplay",
24
+ "type": "boolean",
25
+ "default": false
26
26
  },
27
27
  {
28
- "name": "videoTitle",
29
- "type": "string",
30
- "default": ""
28
+ "name": "controls",
29
+ "type": "boolean",
30
+ "default": true
31
31
  },
32
32
  {
33
- "name": "videoDescription",
34
- "type": "string",
35
- "default": ""
36
- },
37
- {
38
- "name": "searchStatus",
39
- "type": "string",
40
- "default": "idle"
33
+ "name": "start",
34
+ "type": "number",
35
+ "default": 0.0
41
36
  },
42
37
  {
43
38
  "name": "error",
@@ -69,6 +64,125 @@
69
64
  ]
70
65
  },
71
66
  "traits": [
67
+ {
68
+ "name": "ServiceYoutubeDefaultPlayer",
69
+ "category": "interaction",
70
+ "emits": [
71
+ {
72
+ "event": "PLAY",
73
+ "scope": "external",
74
+ "payloadSchema": [
75
+ {
76
+ "name": "source",
77
+ "type": "string"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "event": "READY",
83
+ "scope": "external",
84
+ "payloadSchema": [
85
+ {
86
+ "name": "source",
87
+ "type": "string"
88
+ }
89
+ ]
90
+ }
91
+ ],
92
+ "stateMachine": {
93
+ "states": [
94
+ {
95
+ "name": "ready",
96
+ "isInitial": true
97
+ }
98
+ ],
99
+ "events": [
100
+ {
101
+ "key": "INIT",
102
+ "name": "Initialize"
103
+ },
104
+ {
105
+ "key": "PLAY",
106
+ "name": "Play"
107
+ },
108
+ {
109
+ "key": "READY",
110
+ "name": "Ready"
111
+ }
112
+ ],
113
+ "transitions": [
114
+ {
115
+ "from": "ready",
116
+ "to": "ready",
117
+ "event": "INIT",
118
+ "effects": [
119
+ [
120
+ "render-ui",
121
+ "main",
122
+ {
123
+ "children": [
124
+ {
125
+ "gap": "md",
126
+ "type": "stack",
127
+ "direction": "vertical",
128
+ "children": [
129
+ {
130
+ "type": "icon",
131
+ "name": "video"
132
+ },
133
+ {
134
+ "content": "YouTube Video",
135
+ "type": "typography",
136
+ "variant": "h2"
137
+ },
138
+ {
139
+ "content": "@config.videoId",
140
+ "color": "muted",
141
+ "type": "typography",
142
+ "variant": "body"
143
+ },
144
+ {
145
+ "gap": "sm",
146
+ "justify": "center",
147
+ "children": [
148
+ {
149
+ "variant": "primary",
150
+ "action": "PLAY",
151
+ "icon": "play",
152
+ "label": "Play",
153
+ "type": "button"
154
+ }
155
+ ],
156
+ "type": "stack",
157
+ "direction": "horizontal"
158
+ }
159
+ ],
160
+ "align": "center"
161
+ }
162
+ ],
163
+ "type": "card"
164
+ }
165
+ ]
166
+ ]
167
+ },
168
+ {
169
+ "from": "ready",
170
+ "to": "ready",
171
+ "event": "PLAY",
172
+ "effects": [
173
+ [
174
+ "emit",
175
+ "PLAY",
176
+ {
177
+ "source": "default-player"
178
+ }
179
+ ]
180
+ ]
181
+ }
182
+ ]
183
+ },
184
+ "scope": "instance"
185
+ },
72
186
  {
73
187
  "name": "ServiceYoutubeYoutube",
74
188
  "category": "interaction",
@@ -95,12 +209,12 @@
95
209
  ]
96
210
  },
97
211
  {
98
- "event": "ServiceYoutubeYoutubeCompleted",
212
+ "event": "ServiceYoutubeYoutubeReady",
99
213
  "scope": "external",
100
214
  "payloadSchema": [
101
215
  {
102
- "name": "result",
103
- "type": "object"
216
+ "name": "videoId",
217
+ "type": "string"
104
218
  }
105
219
  ]
106
220
  },
@@ -117,6 +231,26 @@
117
231
  "type": "string"
118
232
  }
119
233
  ]
234
+ },
235
+ {
236
+ "event": "FAILED",
237
+ "payloadSchema": [
238
+ {
239
+ "name": "error",
240
+ "type": "string",
241
+ "required": true
242
+ }
243
+ ]
244
+ }
245
+ ],
246
+ "listens": [
247
+ {
248
+ "event": "READY",
249
+ "triggers": "READY",
250
+ "source": {
251
+ "kind": "trait",
252
+ "trait": "ServiceYoutubeDefaultPlayer"
253
+ }
120
254
  }
121
255
  ],
122
256
  "stateMachine": {
@@ -126,13 +260,7 @@
126
260
  "isInitial": true
127
261
  },
128
262
  {
129
- "name": "searching"
130
- },
131
- {
132
- "name": "results"
133
- },
134
- {
135
- "name": "viewingDetail"
263
+ "name": "ready"
136
264
  },
137
265
  {
138
266
  "name": "error"
@@ -144,19 +272,8 @@
144
272
  "name": "Initialize"
145
273
  },
146
274
  {
147
- "key": "SEARCH",
148
- "name": "Search"
149
- },
150
- {
151
- "key": "SEARCH_COMPLETE",
152
- "name": "Search Complete",
153
- "payloadSchema": [
154
- {
155
- "name": "results",
156
- "type": "string",
157
- "required": true
158
- }
159
- ]
275
+ "key": "READY",
276
+ "name": "Ready"
160
277
  },
161
278
  {
162
279
  "key": "FAILED",
@@ -169,88 +286,12 @@
169
286
  }
170
287
  ]
171
288
  },
172
- {
173
- "key": "SELECT_VIDEO",
174
- "name": "Select Video",
175
- "payloadSchema": [
176
- {
177
- "name": "videoId",
178
- "type": "string",
179
- "required": true
180
- }
181
- ]
182
- },
183
- {
184
- "key": "RESET",
185
- "name": "Reset"
186
- },
187
- {
188
- "key": "VIDEO_LOADED",
189
- "name": "Video Loaded",
190
- "payloadSchema": [
191
- {
192
- "name": "title",
193
- "type": "string",
194
- "required": true
195
- },
196
- {
197
- "name": "description",
198
- "type": "string",
199
- "required": true
200
- }
201
- ]
202
- },
203
- {
204
- "key": "BACK",
205
- "name": "Back"
206
- },
207
289
  {
208
290
  "key": "ServiceYoutubeLoaded",
209
291
  "name": "ServiceYoutube loaded",
210
292
  "payloadSchema": [
211
293
  {
212
294
  "name": "id",
213
- "type": "string",
214
- "required": true
215
- },
216
- {
217
- "name": "query",
218
- "type": "string"
219
- },
220
- {
221
- "name": "selectedVideoId",
222
- "type": "string"
223
- },
224
- {
225
- "name": "videoTitle",
226
- "type": "string"
227
- },
228
- {
229
- "name": "videoDescription",
230
- "type": "string"
231
- },
232
- {
233
- "name": "searchStatus",
234
- "type": "string"
235
- },
236
- {
237
- "name": "error",
238
- "type": "string"
239
- },
240
- {
241
- "name": "name",
242
- "type": "string"
243
- },
244
- {
245
- "name": "description",
246
- "type": "string"
247
- },
248
- {
249
- "name": "status",
250
- "type": "string"
251
- },
252
- {
253
- "name": "createdAt",
254
295
  "type": "string"
255
296
  }
256
297
  ]
@@ -266,12 +307,12 @@
266
307
  ]
267
308
  },
268
309
  {
269
- "key": "ServiceYoutubeYoutubeCompleted",
270
- "name": "ServiceYoutube youtube completed",
310
+ "key": "ServiceYoutubeYoutubeReady",
311
+ "name": "ServiceYoutube youtube ready",
271
312
  "payloadSchema": [
272
313
  {
273
- "name": "result",
274
- "type": "object"
314
+ "name": "videoId",
315
+ "type": "string"
275
316
  }
276
317
  ]
277
318
  },
@@ -288,6 +329,10 @@
288
329
  "type": "string"
289
330
  }
290
331
  ]
332
+ },
333
+ {
334
+ "key": "RETRY",
335
+ "name": "Retry"
291
336
  }
292
337
  ],
293
338
  "transitions": [
@@ -298,8 +343,23 @@
298
343
  "effects": [
299
344
  [
300
345
  "set",
301
- "@entity.query",
302
- ""
346
+ "@entity.videoId",
347
+ "@config.videoId"
348
+ ],
349
+ [
350
+ "set",
351
+ "@entity.autoplay",
352
+ "@config.autoplay"
353
+ ],
354
+ [
355
+ "set",
356
+ "@entity.controls",
357
+ "@config.controls"
358
+ ],
359
+ [
360
+ "set",
361
+ "@entity.start",
362
+ "@config.start"
303
363
  ],
304
364
  [
305
365
  "fetch",
@@ -315,42 +375,11 @@
315
375
  "render-ui",
316
376
  "main",
317
377
  {
318
- "gap": "lg",
319
- "type": "stack",
378
+ "gap": "md",
320
379
  "direction": "vertical",
321
- "align": "stretch",
380
+ "type": "stack",
322
381
  "children": [
323
- {
324
- "gap": "md",
325
- "align": "center",
326
- "type": "stack",
327
- "children": [
328
- {
329
- "name": "video",
330
- "type": "icon"
331
- },
332
- {
333
- "type": "typography",
334
- "variant": "h2",
335
- "content": "YouTube Search"
336
- }
337
- ],
338
- "direction": "horizontal"
339
- },
340
- {
341
- "type": "divider"
342
- },
343
- {
344
- "type": "input",
345
- "placeholder": "Search YouTube videos..."
346
- },
347
- {
348
- "label": "Search",
349
- "type": "button",
350
- "action": "SEARCH",
351
- "variant": "primary",
352
- "icon": "search"
353
- }
382
+ "@config.uiTrait"
354
383
  ]
355
384
  }
356
385
  ]
@@ -358,109 +387,32 @@
358
387
  },
359
388
  {
360
389
  "from": "idle",
361
- "to": "searching",
362
- "event": "SEARCH",
390
+ "to": "ready",
391
+ "event": "READY",
363
392
  "effects": [
364
393
  [
365
- "render-ui",
366
- "main",
367
- {
368
- "type": "loading-state",
369
- "message": "Searching YouTube for videos...",
370
- "title": "Searching..."
371
- }
372
- ],
373
- [
374
- "call-service",
375
- "youtube",
376
- "search",
377
- {
378
- "maxResults": 10.0,
379
- "type": "video",
380
- "query": "@entity.query"
381
- },
394
+ "emit",
395
+ "ServiceYoutubeYoutubeReady",
382
396
  {
383
- "emit": {
384
- "failure": "ServiceYoutubeYoutubeFailed",
385
- "success": "ServiceYoutubeYoutubeCompleted"
386
- }
397
+ "videoId": "@entity.videoId"
387
398
  }
388
- ]
389
- ]
390
- },
391
- {
392
- "from": "searching",
393
- "to": "results",
394
- "event": "SEARCH_COMPLETE",
395
- "effects": [
396
- [
397
- "set",
398
- "@entity.searchStatus",
399
- "complete"
400
399
  ],
401
400
  [
402
401
  "render-ui",
403
402
  "main",
404
403
  {
405
404
  "type": "stack",
406
- "gap": "lg",
405
+ "direction": "vertical",
406
+ "gap": "md",
407
407
  "children": [
408
- {
409
- "direction": "horizontal",
410
- "align": "center",
411
- "gap": "md",
412
- "children": [
413
- {
414
- "name": "video",
415
- "type": "icon"
416
- },
417
- {
418
- "content": "Search Results",
419
- "variant": "h2",
420
- "type": "typography"
421
- }
422
- ],
423
- "type": "stack"
424
- },
425
- {
426
- "type": "divider"
427
- },
428
- {
429
- "content": "Select a video to view details.",
430
- "variant": "body",
431
- "type": "typography"
432
- },
433
- {
434
- "children": [
435
- {
436
- "type": "button",
437
- "variant": "ghost",
438
- "label": "New Search",
439
- "icon": "rotate-ccw",
440
- "action": "RESET"
441
- },
442
- {
443
- "icon": "search",
444
- "action": "SEARCH",
445
- "type": "button",
446
- "label": "Search Again",
447
- "variant": "ghost"
448
- }
449
- ],
450
- "type": "stack",
451
- "justify": "center",
452
- "direction": "horizontal",
453
- "gap": "sm"
454
- }
455
- ],
456
- "align": "stretch",
457
- "direction": "vertical"
408
+ "@config.uiTrait"
409
+ ]
458
410
  }
459
411
  ]
460
412
  ]
461
413
  },
462
414
  {
463
- "from": "searching",
415
+ "from": "idle",
464
416
  "to": "error",
465
417
  "event": "FAILED",
466
418
  "effects": [
@@ -470,363 +422,130 @@
470
422
  "@payload.error"
471
423
  ],
472
424
  [
473
- "set",
474
- "@entity.searchStatus",
475
- "error"
476
- ],
477
- [
478
- "render-ui",
479
- "main",
425
+ "emit",
426
+ "ServiceYoutubeYoutubeFailed",
480
427
  {
481
- "gap": "lg",
482
- "align": "center",
483
- "type": "stack",
484
- "children": [
485
- {
486
- "type": "error-state",
487
- "message": "@entity.error",
488
- "onRetry": "SEARCH",
489
- "title": "Search Failed"
490
- },
491
- {
492
- "type": "stack",
493
- "direction": "horizontal",
494
- "gap": "sm",
495
- "children": [
496
- {
497
- "label": "Retry",
498
- "action": "SEARCH",
499
- "variant": "primary",
500
- "type": "button",
501
- "icon": "refresh-cw"
502
- },
503
- {
504
- "icon": "rotate-ccw",
505
- "label": "Reset",
506
- "type": "button",
507
- "action": "RESET",
508
- "variant": "ghost"
509
- }
510
- ],
511
- "justify": "center"
512
- }
513
- ],
514
- "direction": "vertical"
428
+ "error": "@entity.error",
429
+ "code": "youtube_embed_failed"
515
430
  }
516
- ]
517
- ]
518
- },
519
- {
520
- "from": "results",
521
- "to": "searching",
522
- "event": "SEARCH",
523
- "effects": [
431
+ ],
524
432
  [
525
433
  "render-ui",
526
434
  "main",
527
435
  {
528
- "type": "loading-state",
529
- "message": "Searching YouTube for videos...",
530
- "title": "Searching..."
531
- }
532
- ],
533
- [
534
- "call-service",
535
- "youtube",
536
- "search",
537
- {
538
- "query": "@entity.query",
539
- "maxResults": 10.0,
540
- "type": "video"
541
- },
542
- {
543
- "emit": {
544
- "success": "ServiceYoutubeYoutubeCompleted",
545
- "failure": "ServiceYoutubeYoutubeFailed"
546
- }
436
+ "message": "@entity.error",
437
+ "type": "error-state",
438
+ "onRetry": "RETRY",
439
+ "title": "Video Failed"
547
440
  }
548
441
  ]
549
442
  ]
550
443
  },
551
444
  {
552
- "from": "results",
553
- "to": "viewingDetail",
554
- "event": "SELECT_VIDEO",
555
- "effects": [
556
- [
557
- "set",
558
- "@entity.selectedVideoId",
559
- "@payload.videoId"
560
- ],
561
- [
562
- "render-ui",
563
- "main",
564
- {
565
- "title": "Loading video...",
566
- "type": "loading-state",
567
- "message": "Fetching video details..."
568
- }
569
- ],
570
- [
571
- "call-service",
572
- "youtube",
573
- "getVideo",
574
- {
575
- "videoId": "@payload.videoId"
576
- },
577
- {
578
- "emit": {
579
- "failure": "ServiceYoutubeYoutubeFailed",
580
- "success": "ServiceYoutubeYoutubeCompleted"
581
- }
582
- }
583
- ]
584
- ]
445
+ "from": "idle",
446
+ "to": "idle",
447
+ "event": "ServiceYoutubeLoaded"
585
448
  },
586
449
  {
587
- "from": "results",
450
+ "from": "idle",
588
451
  "to": "idle",
589
- "event": "RESET",
590
- "effects": [
591
- [
592
- "set",
593
- "@entity.searchStatus",
594
- "idle"
595
- ],
596
- [
597
- "render-ui",
598
- "main",
599
- {
600
- "align": "stretch",
601
- "gap": "lg",
602
- "direction": "vertical",
603
- "type": "stack",
604
- "children": [
605
- {
606
- "direction": "horizontal",
607
- "align": "center",
608
- "gap": "md",
609
- "children": [
610
- {
611
- "name": "video",
612
- "type": "icon"
613
- },
614
- {
615
- "variant": "h2",
616
- "content": "YouTube Search",
617
- "type": "typography"
618
- }
619
- ],
620
- "type": "stack"
621
- },
622
- {
623
- "type": "divider"
624
- },
625
- {
626
- "type": "input",
627
- "placeholder": "Search YouTube videos..."
628
- },
629
- {
630
- "variant": "primary",
631
- "icon": "search",
632
- "action": "SEARCH",
633
- "type": "button",
634
- "label": "Search"
635
- }
636
- ]
637
- }
638
- ]
639
- ]
452
+ "event": "ServiceYoutubeLoadFailed"
640
453
  },
641
454
  {
642
- "from": "viewingDetail",
643
- "to": "viewingDetail",
644
- "event": "VIDEO_LOADED",
455
+ "from": "ready",
456
+ "to": "ready",
457
+ "event": "ServiceYoutubeYoutubeReady"
458
+ },
459
+ {
460
+ "from": "ready",
461
+ "to": "error",
462
+ "event": "FAILED",
645
463
  "effects": [
646
464
  [
647
465
  "set",
648
- "@entity.videoTitle",
649
- "@payload.title"
466
+ "@entity.error",
467
+ "@payload.error"
650
468
  ],
651
469
  [
652
- "set",
653
- "@entity.videoDescription",
654
- "@payload.description"
470
+ "emit",
471
+ "ServiceYoutubeYoutubeFailed",
472
+ {
473
+ "code": "youtube_playback_failed",
474
+ "error": "@entity.error"
475
+ }
655
476
  ],
656
477
  [
657
478
  "render-ui",
658
479
  "main",
659
480
  {
660
- "direction": "vertical",
661
- "gap": "lg",
662
- "type": "stack",
663
- "children": [
664
- {
665
- "type": "stack",
666
- "gap": "md",
667
- "align": "center",
668
- "children": [
669
- {
670
- "type": "icon",
671
- "name": "video"
672
- },
673
- {
674
- "content": "@entity.videoTitle",
675
- "type": "typography",
676
- "variant": "h2"
677
- }
678
- ],
679
- "direction": "horizontal"
680
- },
681
- {
682
- "type": "divider"
683
- },
684
- {
685
- "variant": "body",
686
- "content": "@entity.videoDescription",
687
- "type": "typography"
688
- },
689
- {
690
- "type": "button",
691
- "variant": "ghost",
692
- "icon": "arrow-left",
693
- "label": "Back to Results",
694
- "action": "BACK"
695
- }
696
- ],
697
- "align": "stretch"
481
+ "message": "@entity.error",
482
+ "type": "error-state",
483
+ "title": "Video Failed",
484
+ "onRetry": "RETRY"
698
485
  }
699
486
  ]
700
487
  ]
701
488
  },
702
489
  {
703
- "from": "viewingDetail",
704
- "to": "results",
705
- "event": "BACK",
706
- "effects": [
707
- [
708
- "render-ui",
709
- "main",
710
- {
711
- "type": "stack",
712
- "direction": "vertical",
713
- "children": [
714
- {
715
- "children": [
716
- {
717
- "type": "icon",
718
- "name": "video"
719
- },
720
- {
721
- "variant": "h2",
722
- "type": "typography",
723
- "content": "Search Results"
724
- }
725
- ],
726
- "type": "stack",
727
- "gap": "md",
728
- "align": "center",
729
- "direction": "horizontal"
730
- },
731
- {
732
- "type": "divider"
733
- },
734
- {
735
- "variant": "body",
736
- "type": "typography",
737
- "content": "Select a video to view details."
738
- },
739
- {
740
- "children": [
741
- {
742
- "label": "New Search",
743
- "variant": "ghost",
744
- "type": "button",
745
- "action": "RESET",
746
- "icon": "rotate-ccw"
747
- },
748
- {
749
- "action": "SEARCH",
750
- "variant": "ghost",
751
- "icon": "search",
752
- "type": "button",
753
- "label": "Search Again"
754
- }
755
- ],
756
- "direction": "horizontal",
757
- "gap": "sm",
758
- "justify": "center",
759
- "type": "stack"
760
- }
761
- ],
762
- "gap": "lg",
763
- "align": "stretch"
764
- }
765
- ]
766
- ]
490
+ "from": "error",
491
+ "to": "error",
492
+ "event": "ServiceYoutubeYoutubeFailed"
767
493
  },
768
494
  {
769
495
  "from": "error",
770
496
  "to": "idle",
771
- "event": "RESET",
497
+ "event": "RETRY",
772
498
  "effects": [
773
- [
774
- "set",
775
- "@entity.searchStatus",
776
- "idle"
777
- ],
778
499
  [
779
500
  "set",
780
501
  "@entity.error",
781
502
  ""
782
503
  ],
504
+ [
505
+ "emit",
506
+ "FAILED",
507
+ {
508
+ "error": "@entity.error"
509
+ }
510
+ ],
783
511
  [
784
512
  "render-ui",
785
513
  "main",
786
514
  {
515
+ "type": "stack",
516
+ "direction": "vertical",
787
517
  "children": [
788
- {
789
- "type": "stack",
790
- "gap": "md",
791
- "children": [
792
- {
793
- "name": "video",
794
- "type": "icon"
795
- },
796
- {
797
- "type": "typography",
798
- "variant": "h2",
799
- "content": "YouTube Search"
800
- }
801
- ],
802
- "align": "center",
803
- "direction": "horizontal"
804
- },
805
- {
806
- "type": "divider"
807
- },
808
- {
809
- "type": "input",
810
- "placeholder": "Search YouTube videos..."
811
- },
812
- {
813
- "label": "Search",
814
- "type": "button",
815
- "icon": "search",
816
- "variant": "primary",
817
- "action": "SEARCH"
818
- }
518
+ "@config.uiTrait"
819
519
  ],
820
- "gap": "lg",
821
- "direction": "vertical",
822
- "align": "stretch",
823
- "type": "stack"
520
+ "gap": "md"
824
521
  }
825
522
  ]
826
523
  ]
827
524
  }
828
525
  ]
829
526
  },
527
+ "config": {
528
+ "videoId": {
529
+ "type": "string",
530
+ "default": ""
531
+ },
532
+ "uiTrait": {
533
+ "type": "trait",
534
+ "default": "@trait.ServiceYoutubeDefaultPlayer"
535
+ },
536
+ "controls": {
537
+ "type": "boolean",
538
+ "default": true
539
+ },
540
+ "start": {
541
+ "type": "number",
542
+ "default": 0.0
543
+ },
544
+ "autoplay": {
545
+ "type": "boolean",
546
+ "default": false
547
+ }
548
+ },
830
549
  "scope": "instance"
831
550
  }
832
551
  ],