@almadar/std 14.26.0 → 14.27.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 (151) hide show
  1. package/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  2. package/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  3. package/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  4. package/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  5. package/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  6. package/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  7. package/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  8. package/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  9. package/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  10. package/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  11. package/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  12. package/behaviors/registry/app/atoms/std-donor.orb +445 -135
  13. package/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  14. package/behaviors/registry/app/atoms/std-driver.orb +465 -480
  15. package/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  16. package/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  17. package/behaviors/registry/app/atoms/std-event.orb +465 -667
  18. package/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  19. package/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  20. package/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  21. package/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  22. package/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  23. package/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  24. package/behaviors/registry/app/atoms/std-lease.orb +506 -190
  25. package/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  26. package/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  27. package/behaviors/registry/app/atoms/std-matter.orb +486 -318
  28. package/behaviors/registry/app/atoms/std-membership.orb +512 -102
  29. package/behaviors/registry/app/atoms/std-menu.orb +775 -183
  30. package/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  31. package/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  32. package/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  33. package/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  34. package/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  35. package/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  36. package/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  37. package/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  38. package/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  39. package/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  40. package/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  41. package/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  42. package/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  43. package/behaviors/registry/app/atoms/std-segment.orb +360 -98
  44. package/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  45. package/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  46. package/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  47. package/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  48. package/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  49. package/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  50. package/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  51. package/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  52. package/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  53. package/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  54. package/behaviors/registry/app/atoms/std-trial.orb +410 -317
  55. package/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  56. package/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  57. package/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  58. package/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  59. package/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  60. package/behaviors/registry/app/molecules/std-application.orb +178 -263
  61. package/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  62. package/behaviors/registry/app/molecules/std-cart.orb +78 -72
  63. package/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  64. package/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  65. package/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  66. package/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  67. package/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  68. package/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  69. package/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  70. package/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  71. package/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  72. package/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  73. package/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  74. package/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  75. package/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  76. package/dist/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  77. package/dist/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  78. package/dist/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  79. package/dist/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  80. package/dist/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  81. package/dist/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  82. package/dist/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  83. package/dist/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  84. package/dist/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  85. package/dist/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  86. package/dist/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  87. package/dist/behaviors/registry/app/atoms/std-donor.orb +445 -135
  88. package/dist/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  89. package/dist/behaviors/registry/app/atoms/std-driver.orb +465 -480
  90. package/dist/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  91. package/dist/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  92. package/dist/behaviors/registry/app/atoms/std-event.orb +465 -667
  93. package/dist/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  94. package/dist/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  95. package/dist/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  96. package/dist/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  97. package/dist/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  98. package/dist/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  99. package/dist/behaviors/registry/app/atoms/std-lease.orb +506 -190
  100. package/dist/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  101. package/dist/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  102. package/dist/behaviors/registry/app/atoms/std-matter.orb +486 -318
  103. package/dist/behaviors/registry/app/atoms/std-membership.orb +512 -102
  104. package/dist/behaviors/registry/app/atoms/std-menu.orb +775 -183
  105. package/dist/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  106. package/dist/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  107. package/dist/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  108. package/dist/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  109. package/dist/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  110. package/dist/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  111. package/dist/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  112. package/dist/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  113. package/dist/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  114. package/dist/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  115. package/dist/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  116. package/dist/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  117. package/dist/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  118. package/dist/behaviors/registry/app/atoms/std-segment.orb +360 -98
  119. package/dist/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  120. package/dist/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  121. package/dist/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  122. package/dist/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  123. package/dist/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  124. package/dist/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  125. package/dist/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  126. package/dist/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  127. package/dist/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  128. package/dist/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  129. package/dist/behaviors/registry/app/atoms/std-trial.orb +410 -317
  130. package/dist/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  131. package/dist/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  132. package/dist/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  133. package/dist/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  134. package/dist/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  135. package/dist/behaviors/registry/app/molecules/std-application.orb +178 -263
  136. package/dist/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  137. package/dist/behaviors/registry/app/molecules/std-cart.orb +78 -72
  138. package/dist/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  139. package/dist/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  140. package/dist/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  141. package/dist/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  142. package/dist/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  143. package/dist/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  144. package/dist/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  145. package/dist/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  146. package/dist/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  147. package/dist/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  148. package/dist/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  149. package/dist/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  150. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  151. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-form-builder",
3
3
  "version": "1.0.0",
4
- "description": "std-form-builder — survey form composer. One Survey entity holds metadata, a JSON-encoded question library, and JSON-encoded branching rules. Three traits coordinate authoring on a single page: SurveyManage (CRUD on the survey), SurveyQuestions (in-place editing of questionsJson), SurveyBranching (in-place editing of rulesJson).",
4
+ "description": "std-form-builder — survey form composer with list/detail browse + sidebar question and rules editors.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "FormBuilderOrbital",
@@ -54,20 +54,10 @@
54
54
  "linkedEntity": "Survey",
55
55
  "emits": [
56
56
  {
57
- "event": "CREATE",
58
- "payloadSchema": [
59
- {
60
- "name": "data",
61
- "type": "object",
62
- "required": true
63
- }
64
- ]
65
- },
66
- {
67
- "event": "UPDATE",
57
+ "event": "OPEN_SURVEY",
68
58
  "payloadSchema": [
69
59
  {
70
- "name": "surveyId",
60
+ "name": "id",
71
61
  "type": "string",
72
62
  "required": true
73
63
  },
@@ -100,6 +90,19 @@
100
90
  {
101
91
  "name": "row.createdAt",
102
92
  "type": "string"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "event": "CLOSE_VIEW"
98
+ },
99
+ {
100
+ "event": "CREATE",
101
+ "payloadSchema": [
102
+ {
103
+ "name": "id",
104
+ "type": "string",
105
+ "required": true
103
106
  },
104
107
  {
105
108
  "name": "data",
@@ -111,6 +114,11 @@
111
114
  {
112
115
  "event": "PUBLISH",
113
116
  "payloadSchema": [
117
+ {
118
+ "name": "id",
119
+ "type": "string",
120
+ "required": true
121
+ },
114
122
  {
115
123
  "name": "surveyId",
116
124
  "type": "string",
@@ -279,7 +287,7 @@
279
287
  "name": "browsing"
280
288
  },
281
289
  {
282
- "name": "editing"
290
+ "name": "viewing_single"
283
291
  },
284
292
  {
285
293
  "name": "error"
@@ -315,29 +323,29 @@
315
323
  ]
316
324
  },
317
325
  {
318
- "key": "CREATE",
319
- "name": "Create",
326
+ "key": "OPEN_SURVEY",
327
+ "name": "Open Survey",
320
328
  "payloadSchema": [
321
329
  {
322
- "name": "data",
323
- "type": "object",
330
+ "name": "id",
331
+ "type": "string",
324
332
  "required": true
333
+ },
334
+ {
335
+ "name": "row",
336
+ "type": "Survey"
325
337
  }
326
338
  ]
327
339
  },
328
340
  {
329
- "key": "UPDATE",
330
- "name": "Update",
341
+ "key": "CREATE",
342
+ "name": "Create",
331
343
  "payloadSchema": [
332
344
  {
333
- "name": "surveyId",
345
+ "name": "id",
334
346
  "type": "string",
335
347
  "required": true
336
348
  },
337
- {
338
- "name": "row",
339
- "type": "Survey"
340
- },
341
349
  {
342
350
  "name": "data",
343
351
  "type": "object",
@@ -349,6 +357,11 @@
349
357
  "key": "PUBLISH",
350
358
  "name": "Publish",
351
359
  "payloadSchema": [
360
+ {
361
+ "name": "id",
362
+ "type": "string",
363
+ "required": true
364
+ },
352
365
  {
353
366
  "name": "surveyId",
354
367
  "type": "string",
@@ -390,6 +403,10 @@
390
403
  "required": true
391
404
  }
392
405
  ]
406
+ },
407
+ {
408
+ "key": "CLOSE_VIEW",
409
+ "name": "Close View"
393
410
  }
394
411
  ],
395
412
  "transitions": [
@@ -403,8 +420,8 @@
403
420
  "Survey",
404
421
  {
405
422
  "emit": {
406
- "failure": "SurveyLoadFailed",
407
- "success": "SurveyLoaded"
423
+ "success": "SurveyLoaded",
424
+ "failure": "SurveyLoadFailed"
408
425
  }
409
426
  }
410
427
  ],
@@ -412,22 +429,22 @@
412
429
  "render-ui",
413
430
  "main",
414
431
  {
415
- "type": "stack",
416
- "align": "center",
432
+ "direction": "vertical",
417
433
  "className": "py-12",
434
+ "type": "stack",
418
435
  "children": [
419
436
  {
420
437
  "type": "spinner"
421
438
  },
422
439
  {
423
440
  "variant": "caption",
424
- "color": "muted",
425
441
  "type": "typography",
426
- "content": "Loading surveys…"
442
+ "content": "Loading surveys…",
443
+ "color": "muted"
427
444
  }
428
445
  ],
429
446
  "gap": "md",
430
- "direction": "vertical"
447
+ "align": "center"
431
448
  }
432
449
  ]
433
450
  ]
@@ -442,61 +459,88 @@
442
459
  "main",
443
460
  {
444
461
  "type": "stack",
445
- "gap": "lg",
446
462
  "children": [
447
463
  {
448
- "type": "stack",
449
- "justify": "between",
450
- "direction": "horizontal",
451
464
  "gap": "sm",
465
+ "align": "center",
452
466
  "children": [
453
467
  {
454
- "type": "stack",
455
- "gap": "sm",
456
- "direction": "horizontal",
457
- "children": [
458
- {
459
- "type": "icon",
460
- "name": "clipboard-list"
461
- },
462
- {
463
- "variant": "h2",
464
- "type": "typography",
465
- "content": "@config.title"
466
- }
467
- ]
468
+ "type": "icon",
469
+ "name": "clipboard-list"
468
470
  },
469
471
  {
470
- "variant": "primary",
471
- "action": "CREATE",
472
- "label": "New survey",
473
- "type": "button",
474
- "icon": "plus"
472
+ "type": "typography",
473
+ "variant": "h3",
474
+ "content": "@config.title"
475
475
  }
476
- ]
476
+ ],
477
+ "type": "stack",
478
+ "direction": "horizontal"
479
+ },
480
+ {
481
+ "children": [
482
+ {
483
+ "value": "@payload.data.length",
484
+ "label": "Total surveys",
485
+ "type": "stat-display",
486
+ "icon": "clipboard-list"
487
+ },
488
+ {
489
+ "type": "stat-display",
490
+ "value": "5",
491
+ "icon": "edit",
492
+ "label": "Drafts"
493
+ },
494
+ {
495
+ "label": "Published",
496
+ "type": "stat-display",
497
+ "value": "12",
498
+ "icon": "send"
499
+ },
500
+ {
501
+ "type": "stat-display",
502
+ "icon": "users",
503
+ "value": "284",
504
+ "label": "Responses today"
505
+ }
506
+ ],
507
+ "cols": 4.0,
508
+ "type": "simple-grid"
477
509
  },
478
510
  {
479
511
  "type": "divider"
480
512
  },
481
513
  {
482
514
  "type": "data-grid",
483
- "cols": 1.0,
484
- "gap": "sm",
515
+ "itemActions": [
516
+ {
517
+ "variant": "primary",
518
+ "label": "Open",
519
+ "event": "OPEN_SURVEY",
520
+ "icon": "arrow-right"
521
+ },
522
+ {
523
+ "label": "Publish",
524
+ "event": "PUBLISH",
525
+ "icon": "send",
526
+ "variant": "secondary"
527
+ }
528
+ ],
485
529
  "fields": [
486
530
  {
487
- "label": "Title",
531
+ "variant": "caption",
488
532
  "name": "title",
489
- "variant": "h4"
533
+ "label": "Title"
490
534
  },
491
535
  {
492
536
  "name": "description",
493
- "label": "Description",
494
- "variant": "caption"
537
+ "variant": "caption",
538
+ "label": "Description"
495
539
  },
496
540
  {
541
+ "variant": "badge",
497
542
  "name": "status",
498
- "label": "Status",
499
- "variant": "badge"
543
+ "label": "Status"
500
544
  },
501
545
  {
502
546
  "name": "createdAt",
@@ -504,24 +548,13 @@
504
548
  "variant": "caption"
505
549
  }
506
550
  ],
507
- "itemActions": [
508
- {
509
- "variant": "ghost",
510
- "label": "Edit",
511
- "icon": "edit",
512
- "event": "UPDATE"
513
- },
514
- {
515
- "label": "Publish",
516
- "icon": "send",
517
- "event": "PUBLISH",
518
- "variant": "primary"
519
- }
520
- ],
521
- "entity": "@payload.data"
551
+ "entity": "@payload.data",
552
+ "cols": 1.0,
553
+ "gap": "sm"
522
554
  }
523
555
  ],
524
- "direction": "vertical"
556
+ "direction": "vertical",
557
+ "gap": "md"
525
558
  }
526
559
  ]
527
560
  ]
@@ -535,8 +568,8 @@
535
568
  "render-ui",
536
569
  "main",
537
570
  {
538
- "variant": "error",
539
571
  "message": "@payload.error",
572
+ "variant": "error",
540
573
  "type": "alert"
541
574
  }
542
575
  ]
@@ -544,32 +577,13 @@
544
577
  },
545
578
  {
546
579
  "from": "browsing",
547
- "to": "editing",
548
- "event": "CREATE",
549
- "effects": [
550
- [
551
- "persist",
552
- "create",
553
- "Survey",
554
- "@payload.data",
555
- {
556
- "emit": {
557
- "success": "SurveyCreated",
558
- "failure": "SurveyLoadFailed"
559
- }
560
- }
561
- ]
562
- ]
563
- },
564
- {
565
- "from": "browsing",
566
- "to": "editing",
567
- "event": "UPDATE",
580
+ "to": "viewing_single",
581
+ "event": "OPEN_SURVEY",
568
582
  "effects": [
569
583
  [
570
584
  "set",
571
585
  "@entity.id",
572
- "@payload.surveyId"
586
+ "@payload.row.id"
573
587
  ],
574
588
  [
575
589
  "set",
@@ -601,23 +615,187 @@
601
615
  "@entity.createdAt",
602
616
  "@payload.row.createdAt"
603
617
  ],
618
+ [
619
+ "render-ui",
620
+ "main",
621
+ {
622
+ "type": "stack",
623
+ "gap": "md",
624
+ "direction": "vertical",
625
+ "children": [
626
+ {
627
+ "children": [
628
+ {
629
+ "action": "CLOSE_VIEW",
630
+ "type": "button",
631
+ "variant": "ghost",
632
+ "label": "Back"
633
+ },
634
+ {
635
+ "type": "icon",
636
+ "name": "clipboard-list"
637
+ },
638
+ {
639
+ "variant": "h3",
640
+ "type": "typography",
641
+ "content": "@entity.title"
642
+ },
643
+ {
644
+ "type": "badge",
645
+ "variant": "default",
646
+ "label": "@entity.status"
647
+ }
648
+ ],
649
+ "type": "stack",
650
+ "direction": "horizontal",
651
+ "gap": "sm",
652
+ "align": "center"
653
+ },
654
+ {
655
+ "type": "divider"
656
+ },
657
+ {
658
+ "direction": "vertical",
659
+ "type": "stack",
660
+ "gap": "sm",
661
+ "children": [
662
+ {
663
+ "gap": "md",
664
+ "direction": "horizontal",
665
+ "children": [
666
+ {
667
+ "variant": "caption",
668
+ "content": "Description",
669
+ "color": "muted",
670
+ "type": "typography"
671
+ },
672
+ {
673
+ "variant": "body",
674
+ "type": "typography",
675
+ "content": "@entity.description"
676
+ }
677
+ ],
678
+ "type": "stack"
679
+ },
680
+ {
681
+ "direction": "horizontal",
682
+ "type": "stack",
683
+ "gap": "md",
684
+ "children": [
685
+ {
686
+ "variant": "caption",
687
+ "color": "muted",
688
+ "content": "Survey ID",
689
+ "type": "typography"
690
+ },
691
+ {
692
+ "type": "typography",
693
+ "variant": "body",
694
+ "content": "@entity.id"
695
+ }
696
+ ]
697
+ }
698
+ ]
699
+ },
700
+ {
701
+ "type": "divider"
702
+ },
703
+ {
704
+ "type": "simple-grid",
705
+ "cols": 2.0,
706
+ "children": [
707
+ {
708
+ "type": "stat-display",
709
+ "label": "Created",
710
+ "value": "@entity.createdAt",
711
+ "icon": "calendar"
712
+ },
713
+ {
714
+ "label": "Status",
715
+ "type": "stat-display",
716
+ "icon": "activity",
717
+ "value": "@entity.status"
718
+ }
719
+ ]
720
+ },
721
+ {
722
+ "direction": "horizontal",
723
+ "children": [
724
+ {
725
+ "type": "button",
726
+ "label": "Publish",
727
+ "actionPayload": {
728
+ "id": "@entity.id",
729
+ "surveyId": "@entity.id",
730
+ "row": "@entity"
731
+ },
732
+ "variant": "primary",
733
+ "action": "PUBLISH"
734
+ },
735
+ {
736
+ "label": "New Survey",
737
+ "action": "CREATE",
738
+ "variant": "secondary",
739
+ "type": "button",
740
+ "actionPayload": {
741
+ "id": "@entity.id",
742
+ "data": "@entity"
743
+ }
744
+ }
745
+ ],
746
+ "type": "stack",
747
+ "align": "center",
748
+ "gap": "sm"
749
+ }
750
+ ]
751
+ }
752
+ ]
753
+ ]
754
+ },
755
+ {
756
+ "from": "browsing",
757
+ "to": "loading",
758
+ "event": "CREATE",
759
+ "effects": [
604
760
  [
605
761
  "persist",
606
- "update",
762
+ "create",
607
763
  "Survey",
608
- "@entity",
764
+ "@payload.data",
609
765
  {
610
766
  "emit": {
611
767
  "failure": "SurveyLoadFailed",
612
- "success": "SurveyUpdated"
768
+ "success": "SurveyCreated"
613
769
  }
614
770
  }
771
+ ],
772
+ [
773
+ "render-ui",
774
+ "main",
775
+ {
776
+ "type": "stack",
777
+ "gap": "md",
778
+ "direction": "vertical",
779
+ "align": "center",
780
+ "className": "py-12",
781
+ "children": [
782
+ {
783
+ "type": "spinner"
784
+ },
785
+ {
786
+ "variant": "caption",
787
+ "content": "Creating survey…",
788
+ "type": "typography",
789
+ "color": "muted"
790
+ }
791
+ ]
792
+ }
615
793
  ]
616
794
  ]
617
795
  },
618
796
  {
619
797
  "from": "browsing",
620
- "to": "editing",
798
+ "to": "loading",
621
799
  "event": "PUBLISH",
622
800
  "effects": [
623
801
  [
@@ -641,6 +819,28 @@
641
819
  "failure": "SurveyLoadFailed"
642
820
  }
643
821
  }
822
+ ],
823
+ [
824
+ "render-ui",
825
+ "main",
826
+ {
827
+ "direction": "vertical",
828
+ "type": "stack",
829
+ "children": [
830
+ {
831
+ "type": "spinner"
832
+ },
833
+ {
834
+ "content": "Publishing survey…",
835
+ "type": "typography",
836
+ "color": "muted",
837
+ "variant": "caption"
838
+ }
839
+ ],
840
+ "align": "center",
841
+ "className": "py-12",
842
+ "gap": "md"
843
+ }
644
844
  ]
645
845
  ]
646
846
  },
@@ -671,8 +871,8 @@
671
871
  "Survey",
672
872
  {
673
873
  "emit": {
674
- "success": "SurveyLoaded",
675
- "failure": "SurveyLoadFailed"
874
+ "failure": "SurveyLoadFailed",
875
+ "success": "SurveyLoaded"
676
876
  }
677
877
  }
678
878
  ]
@@ -688,8 +888,8 @@
688
888
  "Survey",
689
889
  {
690
890
  "emit": {
691
- "failure": "SurveyLoadFailed",
692
- "success": "SurveyLoaded"
891
+ "success": "SurveyLoaded",
892
+ "failure": "SurveyLoadFailed"
693
893
  }
694
894
  }
695
895
  ]
@@ -704,17 +904,17 @@
704
904
  "render-ui",
705
905
  "main",
706
906
  {
707
- "variant": "error",
907
+ "message": "@payload.error",
708
908
  "type": "alert",
709
- "message": "@payload.error"
909
+ "variant": "error"
710
910
  }
711
911
  ]
712
912
  ]
713
913
  },
714
914
  {
715
- "from": "editing",
915
+ "from": "viewing_single",
716
916
  "to": "loading",
717
- "event": "SurveyCreated",
917
+ "event": "CLOSE_VIEW",
718
918
  "effects": [
719
919
  [
720
920
  "fetch",
@@ -725,55 +925,119 @@
725
925
  "success": "SurveyLoaded"
726
926
  }
727
927
  }
928
+ ],
929
+ [
930
+ "render-ui",
931
+ "main",
932
+ {
933
+ "gap": "md",
934
+ "type": "stack",
935
+ "direction": "vertical",
936
+ "className": "py-12",
937
+ "children": [
938
+ {
939
+ "type": "spinner"
940
+ },
941
+ {
942
+ "color": "muted",
943
+ "content": "Loading surveys…",
944
+ "variant": "caption",
945
+ "type": "typography"
946
+ }
947
+ ],
948
+ "align": "center"
949
+ }
728
950
  ]
729
951
  ]
730
952
  },
731
953
  {
732
- "from": "editing",
954
+ "from": "viewing_single",
733
955
  "to": "loading",
734
- "event": "SurveyUpdated",
956
+ "event": "PUBLISH",
735
957
  "effects": [
736
958
  [
737
- "fetch",
959
+ "set",
960
+ "@entity.id",
961
+ "@payload.id"
962
+ ],
963
+ [
964
+ "set",
965
+ "@entity.status",
966
+ "published"
967
+ ],
968
+ [
969
+ "persist",
970
+ "update",
738
971
  "Survey",
972
+ "@entity",
739
973
  {
740
974
  "emit": {
741
- "success": "SurveyLoaded",
975
+ "success": "SurveyPublished",
742
976
  "failure": "SurveyLoadFailed"
743
977
  }
744
978
  }
979
+ ],
980
+ [
981
+ "render-ui",
982
+ "main",
983
+ {
984
+ "align": "center",
985
+ "className": "py-12",
986
+ "children": [
987
+ {
988
+ "type": "spinner"
989
+ },
990
+ {
991
+ "color": "muted",
992
+ "content": "Publishing survey…",
993
+ "type": "typography",
994
+ "variant": "caption"
995
+ }
996
+ ],
997
+ "gap": "md",
998
+ "type": "stack",
999
+ "direction": "vertical"
1000
+ }
745
1001
  ]
746
1002
  ]
747
1003
  },
748
1004
  {
749
- "from": "editing",
1005
+ "from": "viewing_single",
750
1006
  "to": "loading",
751
- "event": "SurveyPublished",
1007
+ "event": "CREATE",
752
1008
  "effects": [
753
1009
  [
754
- "fetch",
1010
+ "persist",
1011
+ "create",
755
1012
  "Survey",
1013
+ "@payload.data",
756
1014
  {
757
1015
  "emit": {
758
- "success": "SurveyLoaded",
1016
+ "success": "SurveyCreated",
759
1017
  "failure": "SurveyLoadFailed"
760
1018
  }
761
1019
  }
762
- ]
763
- ]
764
- },
765
- {
766
- "from": "editing",
767
- "to": "error",
768
- "event": "SurveyLoadFailed",
769
- "effects": [
1020
+ ],
770
1021
  [
771
1022
  "render-ui",
772
1023
  "main",
773
1024
  {
774
- "variant": "error",
775
- "type": "alert",
776
- "message": "@payload.error"
1025
+ "className": "py-12",
1026
+ "gap": "md",
1027
+ "direction": "vertical",
1028
+ "type": "stack",
1029
+ "align": "center",
1030
+ "children": [
1031
+ {
1032
+ "type": "spinner"
1033
+ },
1034
+ {
1035
+ "type": "typography",
1036
+ "content": "Creating survey…",
1037
+ "variant": "caption",
1038
+ "color": "muted"
1039
+ }
1040
+ ]
777
1041
  }
778
1042
  ]
779
1043
  ]
@@ -788,8 +1052,8 @@
788
1052
  "Survey",
789
1053
  {
790
1054
  "emit": {
791
- "success": "SurveyLoaded",
792
- "failure": "SurveyLoadFailed"
1055
+ "failure": "SurveyLoadFailed",
1056
+ "success": "SurveyLoaded"
793
1057
  }
794
1058
  }
795
1059
  ],
@@ -939,8 +1203,8 @@
939
1203
  "Survey",
940
1204
  {
941
1205
  "emit": {
942
- "failure": "QuestionsSaveFailed",
943
- "success": "SurveyHydrated"
1206
+ "success": "SurveyHydrated",
1207
+ "failure": "QuestionsSaveFailed"
944
1208
  }
945
1209
  }
946
1210
  ],
@@ -949,8 +1213,14 @@
949
1213
  "sidebar",
950
1214
  {
951
1215
  "direction": "vertical",
1216
+ "type": "stack",
1217
+ "gap": "md",
952
1218
  "children": [
953
1219
  {
1220
+ "align": "center",
1221
+ "gap": "sm",
1222
+ "direction": "horizontal",
1223
+ "type": "stack",
954
1224
  "children": [
955
1225
  {
956
1226
  "name": "list-checks",
@@ -961,30 +1231,25 @@
961
1231
  "content": "@config.title",
962
1232
  "type": "typography"
963
1233
  }
964
- ],
965
- "gap": "sm",
966
- "direction": "horizontal",
967
- "type": "stack"
1234
+ ]
968
1235
  },
969
1236
  {
970
1237
  "type": "divider"
971
1238
  },
972
1239
  {
973
- "value": "@entity.questionsJson",
974
- "action": "EDIT_QUESTIONS_JSON",
975
1240
  "placeholder": "Questions JSON",
976
- "type": "input"
1241
+ "type": "input",
1242
+ "value": "@entity.questionsJson",
1243
+ "action": "EDIT_QUESTIONS_JSON"
977
1244
  },
978
1245
  {
979
- "action": "SAVE_QUESTIONS",
980
- "label": "Save questions",
981
1246
  "type": "button",
982
- "variant": "primary",
983
- "icon": "save"
1247
+ "label": "Save questions",
1248
+ "action": "SAVE_QUESTIONS",
1249
+ "icon": "save",
1250
+ "variant": "primary"
984
1251
  }
985
- ],
986
- "type": "stack",
987
- "gap": "md"
1252
+ ]
988
1253
  }
989
1254
  ]
990
1255
  ]
@@ -1182,8 +1447,8 @@
1182
1447
  "Survey",
1183
1448
  {
1184
1449
  "emit": {
1185
- "failure": "RulesSaveFailed",
1186
- "success": "SurveyHydrated"
1450
+ "success": "SurveyHydrated",
1451
+ "failure": "RulesSaveFailed"
1187
1452
  }
1188
1453
  }
1189
1454
  ],
@@ -1191,48 +1456,44 @@
1191
1456
  "render-ui",
1192
1457
  "sidebar",
1193
1458
  {
1194
- "type": "stack",
1195
- "gap": "md",
1459
+ "direction": "vertical",
1196
1460
  "children": [
1197
1461
  {
1462
+ "type": "stack",
1463
+ "direction": "horizontal",
1464
+ "gap": "sm",
1465
+ "align": "center",
1198
1466
  "children": [
1199
1467
  {
1200
1468
  "name": "git-branch",
1201
1469
  "type": "icon"
1202
1470
  },
1203
1471
  {
1204
- "variant": "h3",
1205
1472
  "type": "typography",
1206
- "content": "@config.title"
1473
+ "content": "@config.title",
1474
+ "variant": "h3"
1207
1475
  }
1208
- ],
1209
- "gap": "sm",
1210
- "direction": "horizontal",
1211
- "type": "stack"
1476
+ ]
1212
1477
  },
1213
1478
  {
1214
1479
  "type": "divider"
1215
1480
  },
1216
1481
  {
1217
- "questions": [],
1218
- "type": "branching-logic-builder",
1219
- "rules": []
1220
- },
1221
- {
1222
- "placeholder": "Rules JSON",
1223
- "value": "@entity.rulesJson",
1224
1482
  "type": "input",
1225
- "action": "EDIT_RULES_JSON"
1483
+ "value": "@entity.rulesJson",
1484
+ "action": "EDIT_RULES_JSON",
1485
+ "placeholder": "Rules JSON"
1226
1486
  },
1227
1487
  {
1488
+ "type": "button",
1228
1489
  "variant": "primary",
1229
1490
  "icon": "save",
1230
1491
  "label": "Save rules",
1231
- "type": "button",
1232
1492
  "action": "SAVE_RULES"
1233
1493
  }
1234
1494
  ],
1235
- "direction": "vertical"
1495
+ "gap": "md",
1496
+ "type": "stack"
1236
1497
  }
1237
1498
  ]
1238
1499
  ]
@@ -1261,8 +1522,8 @@
1261
1522
  "@entity",
1262
1523
  {
1263
1524
  "emit": {
1264
- "success": "RulesChanged",
1265
- "failure": "RulesSaveFailed"
1525
+ "failure": "RulesSaveFailed",
1526
+ "success": "RulesChanged"
1266
1527
  }
1267
1528
  }
1268
1529
  ]
@@ -1287,9 +1548,9 @@
1287
1548
  "render-ui",
1288
1549
  "sidebar",
1289
1550
  {
1551
+ "variant": "error",
1290
1552
  "message": "@payload.error",
1291
- "type": "alert",
1292
- "variant": "error"
1553
+ "type": "alert"
1293
1554
  }
1294
1555
  ]
1295
1556
  ]