@almadar/std 14.26.0 → 14.28.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 (175) hide show
  1. package/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  2. package/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  3. package/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  4. package/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  5. package/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  6. package/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  7. package/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  8. package/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  9. package/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  10. package/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  11. package/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  12. package/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  13. package/behaviors/registry/app/atoms/std-donor.orb +445 -135
  14. package/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  15. package/behaviors/registry/app/atoms/std-driver.orb +465 -480
  16. package/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  17. package/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  18. package/behaviors/registry/app/atoms/std-event.orb +465 -667
  19. package/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  20. package/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  21. package/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  22. package/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  23. package/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  24. package/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  25. package/behaviors/registry/app/atoms/std-lease.orb +506 -190
  26. package/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  27. package/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  28. package/behaviors/registry/app/atoms/std-matter.orb +486 -318
  29. package/behaviors/registry/app/atoms/std-membership.orb +512 -102
  30. package/behaviors/registry/app/atoms/std-menu.orb +775 -183
  31. package/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  32. package/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  33. package/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  34. package/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  35. package/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  36. package/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  37. package/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  38. package/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  39. package/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  40. package/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  41. package/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  42. package/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  43. package/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  44. package/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  45. package/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  46. package/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  47. package/behaviors/registry/app/atoms/std-segment.orb +360 -98
  48. package/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  49. package/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  50. package/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  51. package/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  52. package/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  53. package/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  54. package/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  55. package/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  56. package/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  57. package/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  58. package/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  59. package/behaviors/registry/app/atoms/std-trial.orb +410 -317
  60. package/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  61. package/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  62. package/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  63. package/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  64. package/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  65. package/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  66. package/behaviors/registry/app/molecules/std-application.orb +178 -263
  67. package/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  68. package/behaviors/registry/app/molecules/std-cart.orb +78 -72
  69. package/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  70. package/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  71. package/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  72. package/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  73. package/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  74. package/behaviors/registry/core/atoms/std-board.orb +1367 -0
  75. package/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  76. package/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  77. package/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  78. package/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  79. package/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  80. package/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  81. package/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  82. package/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  83. package/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  84. package/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  85. package/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  86. package/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  87. package/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  88. package/dist/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  89. package/dist/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  90. package/dist/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  91. package/dist/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  92. package/dist/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  93. package/dist/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  94. package/dist/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  95. package/dist/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  96. package/dist/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  97. package/dist/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  98. package/dist/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  99. package/dist/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  100. package/dist/behaviors/registry/app/atoms/std-donor.orb +445 -135
  101. package/dist/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  102. package/dist/behaviors/registry/app/atoms/std-driver.orb +465 -480
  103. package/dist/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  104. package/dist/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  105. package/dist/behaviors/registry/app/atoms/std-event.orb +465 -667
  106. package/dist/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  107. package/dist/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  108. package/dist/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  109. package/dist/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  110. package/dist/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  111. package/dist/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  112. package/dist/behaviors/registry/app/atoms/std-lease.orb +506 -190
  113. package/dist/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  114. package/dist/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  115. package/dist/behaviors/registry/app/atoms/std-matter.orb +486 -318
  116. package/dist/behaviors/registry/app/atoms/std-membership.orb +512 -102
  117. package/dist/behaviors/registry/app/atoms/std-menu.orb +775 -183
  118. package/dist/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  119. package/dist/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  120. package/dist/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  121. package/dist/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  122. package/dist/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  123. package/dist/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  124. package/dist/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  125. package/dist/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  126. package/dist/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  127. package/dist/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  128. package/dist/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  129. package/dist/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  130. package/dist/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  131. package/dist/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  132. package/dist/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  133. package/dist/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  134. package/dist/behaviors/registry/app/atoms/std-segment.orb +360 -98
  135. package/dist/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  136. package/dist/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  137. package/dist/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  138. package/dist/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  139. package/dist/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  140. package/dist/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  141. package/dist/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  142. package/dist/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  143. package/dist/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  144. package/dist/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  145. package/dist/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  146. package/dist/behaviors/registry/app/atoms/std-trial.orb +410 -317
  147. package/dist/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  148. package/dist/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  149. package/dist/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  150. package/dist/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  151. package/dist/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  152. package/dist/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  153. package/dist/behaviors/registry/app/molecules/std-application.orb +178 -263
  154. package/dist/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  155. package/dist/behaviors/registry/app/molecules/std-cart.orb +78 -72
  156. package/dist/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  157. package/dist/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  158. package/dist/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  159. package/dist/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  160. package/dist/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  161. package/dist/behaviors/registry/core/atoms/std-board.orb +1367 -0
  162. package/dist/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  163. package/dist/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  164. package/dist/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  165. package/dist/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  166. package/dist/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  167. package/dist/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  168. package/dist/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  169. package/dist/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  170. package/dist/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  171. package/dist/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  172. package/dist/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  173. package/dist/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  174. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  175. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-template-editor",
3
3
  "version": "1.0.0",
4
- "description": "std-template-editor — message template authoring primitive. Edits email/SMS templates with variables like {{firstName}}. Templates are reused across broadcasts and drip sequences.",
4
+ "description": "std-template-editor — message template authoring primitive. Lists templates in `browsing`; opens detail in `viewing_single` with Edit / Save / Delete actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "MessageTemplateOrbital",
@@ -57,6 +57,49 @@
57
57
  "category": "interaction",
58
58
  "linkedEntity": "MessageTemplate",
59
59
  "emits": [
60
+ {
61
+ "event": "OPEN_TEMPLATE",
62
+ "payloadSchema": [
63
+ {
64
+ "name": "id",
65
+ "type": "string",
66
+ "required": true
67
+ },
68
+ {
69
+ "name": "row.id",
70
+ "type": "string",
71
+ "required": true
72
+ },
73
+ {
74
+ "name": "row.name",
75
+ "type": "string",
76
+ "required": true
77
+ },
78
+ {
79
+ "name": "row.channel",
80
+ "type": "string"
81
+ },
82
+ {
83
+ "name": "row.subject",
84
+ "type": "string"
85
+ },
86
+ {
87
+ "name": "row.body",
88
+ "type": "string"
89
+ },
90
+ {
91
+ "name": "row.variables",
92
+ "type": "string"
93
+ },
94
+ {
95
+ "name": "row.lastEditedAt",
96
+ "type": "string"
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ "event": "CLOSE_VIEW"
102
+ },
60
103
  {
61
104
  "event": "EDIT_TEMPLATE",
62
105
  "payloadSchema": [
@@ -77,6 +120,16 @@
77
120
  }
78
121
  ]
79
122
  },
123
+ {
124
+ "event": "DELETE_TEMPLATE",
125
+ "payloadSchema": [
126
+ {
127
+ "name": "id",
128
+ "type": "string",
129
+ "required": true
130
+ }
131
+ ]
132
+ },
80
133
  {
81
134
  "event": "MessageTemplateLoaded",
82
135
  "payloadSchema": [
@@ -110,7 +163,7 @@
110
163
  "name": "browsing"
111
164
  },
112
165
  {
113
- "name": "editing"
166
+ "name": "viewing_single"
114
167
  },
115
168
  {
116
169
  "name": "error"
@@ -145,6 +198,36 @@
145
198
  }
146
199
  ]
147
200
  },
201
+ {
202
+ "key": "OPEN_TEMPLATE",
203
+ "name": "Open Template",
204
+ "payloadSchema": [
205
+ {
206
+ "name": "id",
207
+ "type": "string",
208
+ "required": true
209
+ },
210
+ {
211
+ "name": "row",
212
+ "type": "MessageTemplate"
213
+ }
214
+ ]
215
+ },
216
+ {
217
+ "key": "DELETE_TEMPLATE",
218
+ "name": "Delete Template",
219
+ "payloadSchema": [
220
+ {
221
+ "name": "id",
222
+ "type": "string",
223
+ "required": true
224
+ }
225
+ ]
226
+ },
227
+ {
228
+ "key": "CLOSE_VIEW",
229
+ "name": "Close View"
230
+ },
148
231
  {
149
232
  "key": "EDIT_TEMPLATE",
150
233
  "name": "Edit Template",
@@ -188,22 +271,22 @@
188
271
  "render-ui",
189
272
  "main",
190
273
  {
191
- "type": "stack",
192
- "direction": "vertical",
193
- "align": "center",
274
+ "gap": "md",
194
275
  "className": "py-12",
276
+ "align": "center",
277
+ "type": "stack",
195
278
  "children": [
196
279
  {
197
280
  "type": "spinner"
198
281
  },
199
282
  {
200
- "content": "Loading templates…",
201
283
  "variant": "caption",
284
+ "content": "Loading templates…",
202
285
  "type": "typography",
203
286
  "color": "muted"
204
287
  }
205
288
  ],
206
- "gap": "md"
289
+ "direction": "vertical"
207
290
  }
208
291
  ]
209
292
  ]
@@ -217,72 +300,60 @@
217
300
  "render-ui",
218
301
  "main",
219
302
  {
303
+ "type": "stack",
304
+ "gap": "md",
220
305
  "children": [
221
306
  {
222
- "gap": "sm",
307
+ "direction": "horizontal",
308
+ "align": "center",
223
309
  "children": [
224
310
  {
225
311
  "type": "icon",
226
312
  "name": "file-text"
227
313
  },
228
314
  {
229
- "content": "@config.title",
230
315
  "type": "typography",
231
- "variant": "h3"
316
+ "variant": "h3",
317
+ "content": "@config.title"
232
318
  }
233
319
  ],
234
320
  "type": "stack",
235
- "direction": "horizontal"
236
- },
237
- {
238
- "back": {
239
- "type": "card",
240
- "children": [
241
- {
242
- "type": "typography",
243
- "variant": "body",
244
- "content": "<p>Hi {{firstName}}, welcome aboard.</p>"
245
- }
246
- ]
247
- },
248
- "type": "flip-card",
249
- "height": "180px",
250
- "front": {
251
- "type": "card",
252
- "children": [
253
- {
254
- "gap": "sm",
255
- "type": "stack",
256
- "direction": "vertical",
257
- "children": [
258
- {
259
- "type": "typography",
260
- "content": "Welcome Email",
261
- "variant": "h4"
262
- },
263
- {
264
- "variant": "caption",
265
- "content": "Click to preview HTML",
266
- "type": "typography",
267
- "color": "muted"
268
- }
269
- ]
270
- }
271
- ]
272
- }
321
+ "gap": "sm"
273
322
  },
274
323
  {
275
- "code": "Welcome email template preview placeholder",
276
- "type": "code-block",
277
- "language": "html",
278
- "showCopyButton": true,
279
- "showLanguageBadge": true
324
+ "type": "simple-grid",
325
+ "children": [
326
+ {
327
+ "icon": "file-text",
328
+ "type": "stat-display",
329
+ "label": "Total templates",
330
+ "value": "@payload.data.length"
331
+ },
332
+ {
333
+ "label": "Email",
334
+ "value": "32",
335
+ "type": "stat-display",
336
+ "icon": "mail"
337
+ },
338
+ {
339
+ "icon": "message-square",
340
+ "value": "14",
341
+ "type": "stat-display",
342
+ "label": "SMS"
343
+ },
344
+ {
345
+ "value": "9",
346
+ "icon": "edit",
347
+ "type": "stat-display",
348
+ "label": "Edited 7d"
349
+ }
350
+ ],
351
+ "cols": 4.0
280
352
  },
281
353
  {
282
354
  "type": "divider"
283
355
  },
284
356
  {
285
- "entity": "@payload.data",
286
357
  "fields": [
287
358
  {
288
359
  "name": "name",
@@ -290,36 +361,41 @@
290
361
  "variant": "caption"
291
362
  },
292
363
  {
293
- "label": "Channel",
364
+ "name": "channel",
294
365
  "variant": "badge",
295
- "name": "channel"
366
+ "label": "Channel"
296
367
  },
297
368
  {
298
369
  "label": "Subject",
299
- "name": "subject",
300
- "variant": "caption"
370
+ "variant": "caption",
371
+ "name": "subject"
301
372
  },
302
373
  {
303
- "name": "lastEditedAt",
304
374
  "label": "Updated",
305
- "variant": "caption"
375
+ "variant": "caption",
376
+ "name": "lastEditedAt"
306
377
  }
307
378
  ],
308
- "cols": 1.0,
309
- "gap": "sm",
310
379
  "itemActions": [
311
380
  {
312
- "event": "EDIT_TEMPLATE",
313
- "variant": "ghost",
314
- "label": "Edit"
381
+ "icon": "arrow-right",
382
+ "label": "Open",
383
+ "variant": "primary",
384
+ "event": "OPEN_TEMPLATE"
385
+ },
386
+ {
387
+ "label": "Delete",
388
+ "event": "DELETE_TEMPLATE",
389
+ "variant": "danger"
315
390
  }
316
391
  ],
392
+ "gap": "sm",
393
+ "entity": "@payload.data",
394
+ "cols": 1.0,
317
395
  "type": "data-grid"
318
396
  }
319
397
  ],
320
- "gap": "md",
321
- "direction": "vertical",
322
- "type": "stack"
398
+ "direction": "vertical"
323
399
  }
324
400
  ]
325
401
  ]
@@ -334,77 +410,424 @@
334
410
  "main",
335
411
  {
336
412
  "variant": "error",
337
- "type": "alert",
338
- "message": "@payload.error"
413
+ "message": "@payload.error",
414
+ "type": "alert"
339
415
  }
340
416
  ]
341
417
  ]
342
418
  },
343
419
  {
344
420
  "from": "browsing",
345
- "to": "editing",
346
- "event": "EDIT_TEMPLATE",
421
+ "to": "viewing_single",
422
+ "event": "OPEN_TEMPLATE",
347
423
  "effects": [
348
424
  [
349
425
  "set",
350
426
  "@entity.id",
351
- "@payload.id"
427
+ "@payload.row.id"
428
+ ],
429
+ [
430
+ "set",
431
+ "@entity.name",
432
+ "@payload.row.name"
433
+ ],
434
+ [
435
+ "set",
436
+ "@entity.channel",
437
+ "@payload.row.channel"
438
+ ],
439
+ [
440
+ "set",
441
+ "@entity.subject",
442
+ "@payload.row.subject"
443
+ ],
444
+ [
445
+ "set",
446
+ "@entity.body",
447
+ "@payload.row.body"
448
+ ],
449
+ [
450
+ "set",
451
+ "@entity.variables",
452
+ "@payload.row.variables"
453
+ ],
454
+ [
455
+ "set",
456
+ "@entity.lastEditedAt",
457
+ "@payload.row.lastEditedAt"
352
458
  ],
353
459
  [
354
460
  "render-ui",
355
461
  "main",
356
462
  {
463
+ "direction": "vertical",
357
464
  "children": [
358
465
  {
359
- "gap": "md",
466
+ "direction": "horizontal",
467
+ "type": "stack",
468
+ "gap": "sm",
469
+ "children": [
470
+ {
471
+ "label": "Back",
472
+ "type": "button",
473
+ "variant": "ghost",
474
+ "action": "CLOSE_VIEW"
475
+ },
476
+ {
477
+ "type": "icon",
478
+ "name": "file-text"
479
+ },
480
+ {
481
+ "content": "@entity.name",
482
+ "variant": "h3",
483
+ "type": "typography"
484
+ },
485
+ {
486
+ "type": "badge",
487
+ "variant": "primary",
488
+ "label": "@entity.channel"
489
+ }
490
+ ],
491
+ "align": "center"
492
+ },
493
+ {
494
+ "type": "divider"
495
+ },
496
+ {
497
+ "direction": "vertical",
360
498
  "type": "stack",
499
+ "gap": "sm",
361
500
  "children": [
501
+ {
502
+ "direction": "horizontal",
503
+ "gap": "md",
504
+ "type": "stack",
505
+ "children": [
506
+ {
507
+ "color": "muted",
508
+ "type": "typography",
509
+ "variant": "caption",
510
+ "content": "Subject"
511
+ },
512
+ {
513
+ "type": "typography",
514
+ "variant": "body",
515
+ "content": "@entity.subject"
516
+ }
517
+ ]
518
+ },
362
519
  {
363
520
  "type": "stack",
364
521
  "direction": "horizontal",
365
- "gap": "sm",
522
+ "gap": "md",
366
523
  "children": [
367
524
  {
368
- "type": "icon",
369
- "name": "edit"
525
+ "type": "typography",
526
+ "content": "Body",
527
+ "color": "muted",
528
+ "variant": "caption"
370
529
  },
371
530
  {
372
- "content": "Edit template",
531
+ "variant": "body",
532
+ "content": "@entity.body",
533
+ "type": "typography"
534
+ }
535
+ ]
536
+ },
537
+ {
538
+ "direction": "horizontal",
539
+ "type": "stack",
540
+ "gap": "md",
541
+ "children": [
542
+ {
543
+ "content": "Variables",
373
544
  "type": "typography",
374
- "variant": "h3"
545
+ "color": "muted",
546
+ "variant": "caption"
547
+ },
548
+ {
549
+ "variant": "body",
550
+ "content": "@entity.variables",
551
+ "type": "typography"
375
552
  }
376
553
  ]
554
+ }
555
+ ]
556
+ },
557
+ {
558
+ "type": "divider"
559
+ },
560
+ {
561
+ "cols": 2.0,
562
+ "type": "simple-grid",
563
+ "children": [
564
+ {
565
+ "label": "Channel",
566
+ "type": "stat-display",
567
+ "icon": "send",
568
+ "value": "@entity.channel"
377
569
  },
378
570
  {
379
- "type": "divider"
571
+ "label": "Last edited",
572
+ "type": "stat-display",
573
+ "value": "@entity.lastEditedAt",
574
+ "icon": "calendar"
575
+ }
576
+ ]
577
+ },
578
+ {
579
+ "children": [
580
+ {
581
+ "label": "Edit",
582
+ "variant": "primary",
583
+ "type": "button",
584
+ "action": "EDIT_TEMPLATE",
585
+ "actionPayload": {
586
+ "id": "@entity.id"
587
+ }
380
588
  },
381
589
  {
590
+ "actionPayload": {
591
+ "id": "@entity.id"
592
+ },
382
593
  "label": "Save",
383
594
  "type": "button",
384
- "variant": "primary",
595
+ "variant": "secondary",
385
596
  "action": "SAVE_TEMPLATE"
597
+ },
598
+ {
599
+ "label": "Delete",
600
+ "actionPayload": {
601
+ "id": "@entity.id"
602
+ },
603
+ "variant": "danger",
604
+ "action": "DELETE_TEMPLATE",
605
+ "type": "button"
386
606
  }
387
607
  ],
388
- "direction": "vertical"
608
+ "direction": "horizontal",
609
+ "align": "center",
610
+ "gap": "sm",
611
+ "type": "stack"
389
612
  }
390
613
  ],
391
- "type": "card"
614
+ "type": "stack",
615
+ "gap": "md"
392
616
  }
393
617
  ]
394
618
  ]
395
619
  },
396
620
  {
397
- "from": "editing",
398
- "to": "browsing",
621
+ "from": "browsing",
622
+ "to": "loading",
623
+ "event": "DELETE_TEMPLATE",
624
+ "effects": [
625
+ [
626
+ "set",
627
+ "@entity.id",
628
+ "@payload.id"
629
+ ],
630
+ [
631
+ "fetch",
632
+ "MessageTemplate",
633
+ {
634
+ "emit": {
635
+ "success": "MessageTemplateLoaded",
636
+ "failure": "MessageTemplateLoadFailed"
637
+ }
638
+ }
639
+ ],
640
+ [
641
+ "render-ui",
642
+ "main",
643
+ {
644
+ "className": "py-12",
645
+ "direction": "vertical",
646
+ "children": [
647
+ {
648
+ "type": "spinner"
649
+ },
650
+ {
651
+ "content": "Deleting template…",
652
+ "type": "typography",
653
+ "variant": "caption",
654
+ "color": "muted"
655
+ }
656
+ ],
657
+ "type": "stack",
658
+ "gap": "md",
659
+ "align": "center"
660
+ }
661
+ ]
662
+ ]
663
+ },
664
+ {
665
+ "from": "viewing_single",
666
+ "to": "loading",
667
+ "event": "CLOSE_VIEW",
668
+ "effects": [
669
+ [
670
+ "fetch",
671
+ "MessageTemplate",
672
+ {
673
+ "emit": {
674
+ "success": "MessageTemplateLoaded",
675
+ "failure": "MessageTemplateLoadFailed"
676
+ }
677
+ }
678
+ ],
679
+ [
680
+ "render-ui",
681
+ "main",
682
+ {
683
+ "children": [
684
+ {
685
+ "type": "spinner"
686
+ },
687
+ {
688
+ "color": "muted",
689
+ "type": "typography",
690
+ "content": "Loading templates…",
691
+ "variant": "caption"
692
+ }
693
+ ],
694
+ "type": "stack",
695
+ "className": "py-12",
696
+ "direction": "vertical",
697
+ "gap": "md",
698
+ "align": "center"
699
+ }
700
+ ]
701
+ ]
702
+ },
703
+ {
704
+ "from": "viewing_single",
705
+ "to": "loading",
706
+ "event": "EDIT_TEMPLATE",
707
+ "effects": [
708
+ [
709
+ "set",
710
+ "@entity.id",
711
+ "@payload.id"
712
+ ],
713
+ [
714
+ "fetch",
715
+ "MessageTemplate",
716
+ {
717
+ "emit": {
718
+ "success": "MessageTemplateLoaded",
719
+ "failure": "MessageTemplateLoadFailed"
720
+ }
721
+ }
722
+ ],
723
+ [
724
+ "render-ui",
725
+ "main",
726
+ {
727
+ "align": "center",
728
+ "type": "stack",
729
+ "direction": "vertical",
730
+ "children": [
731
+ {
732
+ "type": "spinner"
733
+ },
734
+ {
735
+ "type": "typography",
736
+ "color": "muted",
737
+ "variant": "caption",
738
+ "content": "Loading editor…"
739
+ }
740
+ ],
741
+ "className": "py-12",
742
+ "gap": "md"
743
+ }
744
+ ]
745
+ ]
746
+ },
747
+ {
748
+ "from": "viewing_single",
749
+ "to": "loading",
399
750
  "event": "SAVE_TEMPLATE",
400
751
  "effects": [
752
+ [
753
+ "set",
754
+ "@entity.id",
755
+ "@payload.id"
756
+ ],
757
+ [
758
+ "fetch",
759
+ "MessageTemplate",
760
+ {
761
+ "emit": {
762
+ "failure": "MessageTemplateLoadFailed",
763
+ "success": "MessageTemplateLoaded"
764
+ }
765
+ }
766
+ ],
401
767
  [
402
768
  "render-ui",
403
769
  "main",
404
770
  {
405
- "variant": "success",
406
- "message": "Template saved",
407
- "type": "alert"
771
+ "className": "py-12",
772
+ "children": [
773
+ {
774
+ "type": "spinner"
775
+ },
776
+ {
777
+ "content": "Saving template…",
778
+ "color": "muted",
779
+ "type": "typography",
780
+ "variant": "caption"
781
+ }
782
+ ],
783
+ "type": "stack",
784
+ "direction": "vertical",
785
+ "gap": "md",
786
+ "align": "center"
787
+ }
788
+ ]
789
+ ]
790
+ },
791
+ {
792
+ "from": "viewing_single",
793
+ "to": "loading",
794
+ "event": "DELETE_TEMPLATE",
795
+ "effects": [
796
+ [
797
+ "set",
798
+ "@entity.id",
799
+ "@payload.id"
800
+ ],
801
+ [
802
+ "fetch",
803
+ "MessageTemplate",
804
+ {
805
+ "emit": {
806
+ "failure": "MessageTemplateLoadFailed",
807
+ "success": "MessageTemplateLoaded"
808
+ }
809
+ }
810
+ ],
811
+ [
812
+ "render-ui",
813
+ "main",
814
+ {
815
+ "className": "py-12",
816
+ "align": "center",
817
+ "direction": "vertical",
818
+ "children": [
819
+ {
820
+ "type": "spinner"
821
+ },
822
+ {
823
+ "content": "Deleting template…",
824
+ "type": "typography",
825
+ "variant": "caption",
826
+ "color": "muted"
827
+ }
828
+ ],
829
+ "gap": "md",
830
+ "type": "stack"
408
831
  }
409
832
  ]
410
833
  ]
@@ -428,8 +851,8 @@
428
851
  "render-ui",
429
852
  "main",
430
853
  {
431
- "size": "sm",
432
- "type": "spinner"
854
+ "type": "spinner",
855
+ "size": "sm"
433
856
  }
434
857
  ]
435
858
  ]