@almadar/std 7.4.1 → 7.4.3

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 (32) hide show
  1. package/behaviors/registry/atoms/std-modal.orb +15 -9
  2. package/behaviors/registry/atoms/std-wizard.orb +306 -293
  3. package/behaviors/registry/molecules/std-detail.orb +513 -292
  4. package/behaviors/registry/molecules/std-geospatial.orb +543 -406
  5. package/behaviors/registry/molecules/std-inventory.orb +489 -445
  6. package/behaviors/registry/molecules/std-list.orb +492 -616
  7. package/behaviors/registry/molecules/std-messaging.orb +511 -327
  8. package/behaviors/registry/molecules/std-wizard-form.orb +2 -101
  9. package/dist/behaviors/behaviors-registry.json +1976 -719
  10. package/dist/behaviors/exports-reader.js +71 -11
  11. package/dist/behaviors/exports-reader.js.map +1 -1
  12. package/dist/behaviors/functions/index.d.ts +11 -3
  13. package/dist/behaviors/functions/index.js +67 -11
  14. package/dist/behaviors/functions/index.js.map +1 -1
  15. package/dist/behaviors/index.d.ts +1 -1
  16. package/dist/behaviors/index.js +72 -12
  17. package/dist/behaviors/index.js.map +1 -1
  18. package/dist/behaviors/query.js +71 -11
  19. package/dist/behaviors/query.js.map +1 -1
  20. package/dist/behaviors/registry/atoms/std-modal.orb +15 -9
  21. package/dist/behaviors/registry/atoms/std-wizard.orb +306 -293
  22. package/dist/behaviors/registry/molecules/std-detail.orb +513 -292
  23. package/dist/behaviors/registry/molecules/std-geospatial.orb +543 -406
  24. package/dist/behaviors/registry/molecules/std-inventory.orb +489 -445
  25. package/dist/behaviors/registry/molecules/std-list.orb +492 -616
  26. package/dist/behaviors/registry/molecules/std-messaging.orb +511 -327
  27. package/dist/behaviors/registry/molecules/std-wizard-form.orb +2 -101
  28. package/dist/behaviors-registry.json +1976 -719
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +72 -12
  31. package/dist/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -6,10 +6,6 @@
6
6
  {
7
7
  "name": "DetailRecordOrbital",
8
8
  "uses": [
9
- {
10
- "from": "std/behaviors/std-browse",
11
- "as": "Browse"
12
- },
13
9
  {
14
10
  "from": "std/behaviors/std-modal",
15
11
  "as": "Modal"
@@ -22,11 +18,13 @@
22
18
  "fields": [
23
19
  {
24
20
  "name": "id",
25
- "type": "string"
21
+ "type": "string",
22
+ "required": true
26
23
  },
27
24
  {
28
25
  "name": "name",
29
- "type": "string"
26
+ "type": "string",
27
+ "required": true
30
28
  },
31
29
  {
32
30
  "name": "description",
@@ -50,366 +48,586 @@
50
48
  },
51
49
  "traits": [
52
50
  {
53
- "ref": "Browse.traits.BrowseItemBrowse",
54
51
  "name": "DetailRecordBrowse",
52
+ "category": "interaction",
55
53
  "linkedEntity": "DetailRecord",
54
+ "emits": [
55
+ {
56
+ "event": "DetailRecordLoaded",
57
+ "description": "Fired when the DetailRecord collection finishes loading",
58
+ "scope": "internal",
59
+ "payload": [
60
+ {
61
+ "name": "data",
62
+ "type": "[DetailRecord]"
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "event": "DetailRecordLoadFailed",
68
+ "description": "Fired when the DetailRecord collection fails to load",
69
+ "scope": "internal",
70
+ "payload": [
71
+ {
72
+ "name": "error",
73
+ "type": "string"
74
+ },
75
+ {
76
+ "name": "code",
77
+ "type": "string"
78
+ }
79
+ ]
80
+ }
81
+ ],
56
82
  "listens": [
57
83
  {
58
84
  "event": "DETAIL_RECORD_CREATED",
59
85
  "triggers": "INIT",
60
86
  "source": {
61
87
  "kind": "trait",
62
- "trait": "DetailRecordCreate"
88
+ "trait": "DetailRecordPersistor"
63
89
  }
64
90
  }
65
91
  ],
66
- "effects": {
67
- "BrowseItemLoaded": [
68
- [
69
- "render-ui",
70
- "main",
71
- {
72
- "type": "stack",
73
- "children": [
92
+ "stateMachine": {
93
+ "states": [
94
+ {
95
+ "name": "loading",
96
+ "isInitial": true
97
+ },
98
+ {
99
+ "name": "browsing"
100
+ },
101
+ {
102
+ "name": "error"
103
+ }
104
+ ],
105
+ "events": [
106
+ {
107
+ "key": "INIT",
108
+ "name": "Initialize"
109
+ },
110
+ {
111
+ "key": "DetailRecordLoaded",
112
+ "name": "DetailRecord loaded",
113
+ "payload": [
114
+ {
115
+ "name": "data",
116
+ "type": "[DetailRecord]"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "key": "DetailRecordLoadFailed",
122
+ "name": "DetailRecord load failed",
123
+ "payload": [
124
+ {
125
+ "name": "error",
126
+ "type": "string"
127
+ },
128
+ {
129
+ "name": "code",
130
+ "type": "string"
131
+ }
132
+ ]
133
+ }
134
+ ],
135
+ "transitions": [
136
+ {
137
+ "from": "loading",
138
+ "to": "loading",
139
+ "event": "INIT",
140
+ "effects": [
141
+ [
142
+ "fetch",
143
+ "DetailRecord",
74
144
  {
75
- "gap": "md",
76
- "justify": "space-between",
145
+ "emit": {
146
+ "success": "DetailRecordLoaded",
147
+ "failure": "DetailRecordLoadFailed"
148
+ }
149
+ }
150
+ ],
151
+ [
152
+ "render-ui",
153
+ "main",
154
+ {
155
+ "direction": "vertical",
156
+ "type": "stack",
157
+ "align": "center",
158
+ "className": "py-12",
77
159
  "children": [
78
160
  {
79
- "type": "stack",
80
- "gap": "sm",
161
+ "size": "lg",
162
+ "type": "spinner"
163
+ },
164
+ {
165
+ "type": "typography",
166
+ "content": "Loading records…",
167
+ "variant": "caption",
168
+ "color": "muted"
169
+ }
170
+ ],
171
+ "gap": "md"
172
+ }
173
+ ]
174
+ ]
175
+ },
176
+ {
177
+ "from": "loading",
178
+ "to": "browsing",
179
+ "event": "DetailRecordLoaded",
180
+ "effects": [
181
+ [
182
+ "render-ui",
183
+ "main",
184
+ {
185
+ "children": [
186
+ {
187
+ "justify": "between",
81
188
  "children": [
82
189
  {
83
- "type": "icon",
84
- "name": "file-text",
85
- "size": "lg"
190
+ "children": [
191
+ {
192
+ "size": "lg",
193
+ "type": "icon",
194
+ "name": "file-text"
195
+ },
196
+ {
197
+ "content": "DetailRecords",
198
+ "variant": "h2",
199
+ "type": "typography"
200
+ }
201
+ ],
202
+ "type": "stack",
203
+ "gap": "md",
204
+ "direction": "horizontal"
86
205
  },
87
206
  {
88
- "variant": "h2",
89
- "type": "typography",
90
- "content": "DetailRecords"
207
+ "variant": "primary",
208
+ "icon": "plus",
209
+ "label": "Create",
210
+ "type": "button",
211
+ "action": "CREATE"
91
212
  }
92
213
  ],
214
+ "gap": "md",
93
215
  "direction": "horizontal",
94
- "align": "center"
216
+ "type": "stack"
95
217
  },
96
218
  {
97
- "event": "CREATE",
98
- "label": "Create DetailRecord",
99
- "icon": "plus",
100
- "type": "button",
101
- "variant": "primary"
219
+ "type": "divider"
220
+ },
221
+ {
222
+ "entity": "@payload.data",
223
+ "itemActions": [
224
+ {
225
+ "event": "VIEW",
226
+ "label": "View",
227
+ "variant": "ghost"
228
+ }
229
+ ],
230
+ "fields": [
231
+ {
232
+ "variant": "h4",
233
+ "icon": "file-text",
234
+ "label": "Name",
235
+ "name": "name"
236
+ },
237
+ {
238
+ "label": "Description",
239
+ "name": "description",
240
+ "variant": "caption"
241
+ },
242
+ {
243
+ "label": "Status",
244
+ "name": "status",
245
+ "variant": "badge"
246
+ }
247
+ ],
248
+ "type": "data-grid"
102
249
  }
103
250
  ],
251
+ "direction": "vertical",
252
+ "className": "max-w-5xl mx-auto w-full",
104
253
  "type": "stack",
105
- "align": "center",
106
- "direction": "horizontal"
107
- },
108
- {
109
- "type": "divider"
110
- },
254
+ "gap": "lg"
255
+ }
256
+ ]
257
+ ]
258
+ },
259
+ {
260
+ "from": "loading",
261
+ "to": "error",
262
+ "event": "DetailRecordLoadFailed",
263
+ "effects": [
264
+ [
265
+ "render-ui",
266
+ "main",
111
267
  {
112
- "emptyTitle": "No detailrecords yet",
113
- "emptyDescription": "Create your first detailrecord to get started.",
114
- "columns": [
268
+ "align": "center",
269
+ "className": "py-12",
270
+ "direction": "vertical",
271
+ "children": [
272
+ {
273
+ "size": "xl",
274
+ "color": "destructive",
275
+ "type": "icon",
276
+ "name": "alert-triangle"
277
+ },
115
278
  {
116
- "icon": "file-text",
117
- "label": "Name",
118
- "name": "name",
119
- "variant": "h4"
279
+ "type": "typography",
280
+ "variant": "h3",
281
+ "content": "Failed to load records"
120
282
  },
121
283
  {
122
- "label": "Description",
123
- "variant": "badge",
124
- "name": "description"
284
+ "type": "typography",
285
+ "variant": "body",
286
+ "content": "@payload.error",
287
+ "color": "muted"
125
288
  },
126
289
  {
127
- "label": "Status",
128
- "name": "status",
129
- "variant": "caption"
290
+ "label": "Retry",
291
+ "icon": "rotate-ccw",
292
+ "type": "button",
293
+ "variant": "primary",
294
+ "action": "INIT"
130
295
  }
131
296
  ],
132
- "entity": "DetailRecord",
133
- "emptyIcon": "inbox",
134
- "type": "data-grid",
135
- "itemActions": [
136
- {
137
- "label": "View",
138
- "size": "sm",
139
- "event": "VIEW",
140
- "variant": "ghost"
141
- }
142
- ]
297
+ "type": "stack",
298
+ "gap": "md"
299
+ }
300
+ ]
301
+ ]
302
+ },
303
+ {
304
+ "from": "browsing",
305
+ "to": "loading",
306
+ "event": "INIT",
307
+ "effects": [
308
+ [
309
+ "fetch",
310
+ "DetailRecord",
311
+ {
312
+ "emit": {
313
+ "success": "DetailRecordLoaded",
314
+ "failure": "DetailRecordLoadFailed"
315
+ }
143
316
  }
144
317
  ],
145
- "direction": "vertical",
146
- "gap": "lg",
147
- "className": "max-w-5xl mx-auto w-full"
148
- }
149
- ]
150
- ],
151
- "INIT": [
152
- [
153
- "fetch",
154
- "DetailRecord"
155
- ]
318
+ [
319
+ "render-ui",
320
+ "main",
321
+ {
322
+ "size": "lg",
323
+ "type": "spinner"
324
+ }
325
+ ]
326
+ ]
327
+ },
328
+ {
329
+ "from": "error",
330
+ "to": "loading",
331
+ "event": "INIT",
332
+ "effects": [
333
+ [
334
+ "fetch",
335
+ "DetailRecord",
336
+ {
337
+ "emit": {
338
+ "failure": "DetailRecordLoadFailed",
339
+ "success": "DetailRecordLoaded"
340
+ }
341
+ }
342
+ ],
343
+ [
344
+ "render-ui",
345
+ "main",
346
+ {
347
+ "size": "lg",
348
+ "type": "spinner"
349
+ }
350
+ ]
351
+ ]
352
+ }
156
353
  ]
157
- }
354
+ },
355
+ "scope": "collection"
158
356
  },
159
357
  {
160
358
  "ref": "Modal.traits.ModalRecordModal",
161
359
  "name": "DetailRecordCreate",
162
360
  "linkedEntity": "DetailRecord",
361
+ "config": {
362
+ "icon": "plus-circle",
363
+ "fields": [
364
+ "name",
365
+ "description",
366
+ "status"
367
+ ],
368
+ "mode": "create",
369
+ "title": "New DetailRecord"
370
+ },
163
371
  "events": {
164
372
  "SAVE": "DETAIL_RECORD_CREATED",
165
373
  "OPEN": "CREATE"
166
- },
167
- "effects": {
168
- "CLOSE": [
169
- [
170
- "render-ui",
171
- "modal",
172
- null
173
- ],
174
- [
175
- "render-ui",
176
- "main",
177
- {
178
- "type": "box"
179
- }
180
- ],
181
- [
182
- "notify",
183
- "Cancelled",
184
- "info"
185
- ]
186
- ],
187
- "CREATE": [
188
- [
189
- "render-ui",
190
- "modal",
191
- {
192
- "gap": "md",
193
- "type": "stack",
194
- "children": [
195
- {
196
- "gap": "sm",
197
- "type": "stack",
198
- "direction": "horizontal",
199
- "children": [
200
- {
201
- "name": "plus-circle",
202
- "size": "md",
203
- "type": "icon"
204
- },
205
- {
206
- "content": "New DetailRecord",
207
- "type": "typography",
208
- "variant": "h3"
209
- }
210
- ]
211
- },
212
- {
213
- "type": "divider"
214
- },
215
- {
216
- "type": "form-section",
217
- "mode": "create",
218
- "submitEvent": "SAVE",
219
- "cancelEvent": "CLOSE",
220
- "fields": [
221
- "name",
222
- "description",
223
- "status"
224
- ],
225
- "entity": "DetailRecord"
226
- }
227
- ],
228
- "direction": "vertical"
229
- }
230
- ]
231
- ],
232
- "INIT": [
233
- [
234
- "fetch",
235
- "DetailRecord"
236
- ]
237
- ],
238
- "DETAIL_RECORD_CREATED": [
239
- [
240
- "persist",
241
- "create",
242
- "DetailRecord",
243
- "@payload.data"
244
- ],
245
- [
246
- "render-ui",
247
- "modal",
248
- null
249
- ],
250
- [
251
- "render-ui",
252
- "main",
253
- {
254
- "type": "box"
255
- }
256
- ]
257
- ]
258
374
  }
259
375
  },
260
376
  {
261
- "ref": "Modal.traits.ModalRecordModal",
262
377
  "name": "DetailRecordView",
378
+ "category": "interaction",
263
379
  "linkedEntity": "DetailRecord",
264
- "events": {
265
- "OPEN": "VIEW",
266
- "SAVE": "DETAIL_RECORD_VIEWED"
267
- },
268
- "effects": {
269
- "INIT": [
270
- [
271
- "fetch",
272
- "DetailRecord"
273
- ]
380
+ "stateMachine": {
381
+ "states": [
382
+ {
383
+ "name": "closed",
384
+ "isInitial": true
385
+ }
274
386
  ],
275
- "DETAIL_RECORD_VIEWED": [
276
- [
277
- "render-ui",
278
- "modal",
279
- null
280
- ],
281
- [
282
- "render-ui",
283
- "main",
284
- {
285
- "type": "box"
286
- }
287
- ]
387
+ "events": [
388
+ {
389
+ "key": "INIT",
390
+ "name": "Initialize"
391
+ },
392
+ {
393
+ "key": "VIEW",
394
+ "name": "View",
395
+ "payload": [
396
+ {
397
+ "name": "id",
398
+ "type": "string",
399
+ "required": true
400
+ }
401
+ ]
402
+ },
403
+ {
404
+ "key": "CLOSE",
405
+ "name": "Close"
406
+ }
288
407
  ],
289
- "VIEW": [
290
- [
291
- "fetch",
292
- "DetailRecord",
293
- {
294
- "id": "@payload.id"
295
- }
296
- ],
297
- [
298
- "render-ui",
299
- "modal",
300
- {
301
- "direction": "vertical",
302
- "type": "stack",
303
- "gap": "md",
304
- "children": [
408
+ "transitions": [
409
+ {
410
+ "from": "closed",
411
+ "to": "closed",
412
+ "event": "INIT",
413
+ "effects": [
414
+ [
415
+ "fetch",
416
+ "DetailRecord"
417
+ ]
418
+ ]
419
+ },
420
+ {
421
+ "from": "closed",
422
+ "to": "closed",
423
+ "event": "VIEW",
424
+ "effects": [
425
+ [
426
+ "set",
427
+ "@entity.id",
428
+ "@payload.id"
429
+ ],
430
+ [
431
+ "render-ui",
432
+ "modal",
305
433
  {
434
+ "gap": "md",
306
435
  "type": "stack",
307
- "gap": "sm",
308
- "direction": "horizontal",
309
- "align": "center",
436
+ "direction": "vertical",
310
437
  "children": [
311
438
  {
312
- "name": "eye",
313
- "type": "icon",
314
- "size": "md"
439
+ "gap": "sm",
440
+ "children": [
441
+ {
442
+ "name": "eye",
443
+ "size": "md",
444
+ "type": "icon"
445
+ },
446
+ {
447
+ "content": "@entity.name",
448
+ "type": "typography",
449
+ "variant": "h3"
450
+ }
451
+ ],
452
+ "type": "stack",
453
+ "direction": "horizontal",
454
+ "align": "center"
315
455
  },
316
456
  {
317
- "type": "typography",
318
- "variant": "h3",
319
- "content": "@entity.name"
320
- }
321
- ]
322
- },
323
- {
324
- "type": "divider"
325
- },
326
- {
327
- "gap": "md",
328
- "direction": "horizontal",
329
- "children": [
330
- {
331
- "content": "Name",
332
- "type": "typography",
333
- "variant": "caption"
457
+ "type": "divider"
334
458
  },
335
459
  {
336
- "variant": "body",
337
- "type": "typography",
338
- "content": "@entity.name"
339
- }
340
- ],
341
- "type": "stack"
342
- },
343
- {
344
- "children": [
345
- {
346
- "variant": "caption",
347
- "content": "Description",
348
- "type": "typography"
460
+ "gap": "md",
461
+ "direction": "horizontal",
462
+ "type": "stack",
463
+ "children": [
464
+ {
465
+ "variant": "caption",
466
+ "type": "typography",
467
+ "content": "Name"
468
+ },
469
+ {
470
+ "content": "@entity.name",
471
+ "type": "typography",
472
+ "variant": "body"
473
+ }
474
+ ]
349
475
  },
350
476
  {
351
- "type": "typography",
352
- "variant": "body",
353
- "content": "@entity.description"
354
- }
355
- ],
356
- "type": "stack",
357
- "direction": "horizontal",
358
- "gap": "md"
359
- },
360
- {
361
- "type": "stack",
362
- "direction": "horizontal",
363
- "gap": "md",
364
- "children": [
477
+ "direction": "horizontal",
478
+ "children": [
479
+ {
480
+ "type": "typography",
481
+ "content": "Description",
482
+ "variant": "caption"
483
+ },
484
+ {
485
+ "content": "@entity.description",
486
+ "type": "typography",
487
+ "variant": "body"
488
+ }
489
+ ],
490
+ "type": "stack",
491
+ "gap": "md"
492
+ },
365
493
  {
366
- "type": "typography",
367
- "content": "Status",
368
- "variant": "caption"
494
+ "direction": "horizontal",
495
+ "gap": "md",
496
+ "type": "stack",
497
+ "children": [
498
+ {
499
+ "type": "typography",
500
+ "content": "Status",
501
+ "variant": "caption"
502
+ },
503
+ {
504
+ "variant": "body",
505
+ "content": "@entity.status",
506
+ "type": "typography"
507
+ }
508
+ ]
369
509
  },
370
510
  {
371
- "content": "@entity.status",
372
- "type": "typography",
373
- "variant": "body"
374
- }
375
- ]
376
- },
377
- {
378
- "type": "divider"
379
- },
380
- {
381
- "direction": "horizontal",
382
- "justify": "end",
383
- "gap": "sm",
384
- "type": "stack",
385
- "children": [
511
+ "type": "divider"
512
+ },
386
513
  {
387
- "type": "button",
388
- "variant": "ghost",
389
- "event": "CLOSE",
390
- "label": "Close"
514
+ "gap": "sm",
515
+ "children": [
516
+ {
517
+ "type": "button",
518
+ "label": "Close",
519
+ "variant": "ghost",
520
+ "action": "CLOSE"
521
+ }
522
+ ],
523
+ "direction": "horizontal",
524
+ "justify": "end",
525
+ "type": "stack"
391
526
  }
392
527
  ]
393
528
  }
394
529
  ]
395
- }
396
- ]
397
- ],
398
- "CLOSE": [
399
- [
400
- "render-ui",
401
- "modal",
402
- null
403
- ],
404
- [
405
- "render-ui",
406
- "main",
530
+ ]
531
+ },
532
+ {
533
+ "from": "closed",
534
+ "to": "closed",
535
+ "event": "CLOSE",
536
+ "effects": [
537
+ [
538
+ "render-ui",
539
+ "modal",
540
+ null
541
+ ]
542
+ ]
543
+ }
544
+ ]
545
+ },
546
+ "scope": "instance"
547
+ },
548
+ {
549
+ "name": "DetailRecordPersistor",
550
+ "category": "lifecycle",
551
+ "linkedEntity": "DetailRecord",
552
+ "emits": [
553
+ {
554
+ "event": "DETAIL_RECORD_CREATED",
555
+ "scope": "external",
556
+ "payload": [
407
557
  {
408
- "type": "box"
558
+ "name": "id",
559
+ "type": "string",
560
+ "required": true
409
561
  }
410
562
  ]
563
+ }
564
+ ],
565
+ "listens": [
566
+ {
567
+ "event": "DETAIL_RECORD_CREATED",
568
+ "triggers": "DO_CREATE",
569
+ "source": {
570
+ "kind": "trait",
571
+ "trait": "DetailRecordCreate"
572
+ }
573
+ }
574
+ ],
575
+ "stateMachine": {
576
+ "states": [
577
+ {
578
+ "name": "idle",
579
+ "isInitial": true
580
+ }
581
+ ],
582
+ "events": [
583
+ {
584
+ "key": "INIT",
585
+ "name": "Initialize"
586
+ },
587
+ {
588
+ "key": "DO_CREATE",
589
+ "name": "Do Create",
590
+ "payload": [
591
+ {
592
+ "name": "data",
593
+ "type": "DetailRecord"
594
+ }
595
+ ]
596
+ },
597
+ {
598
+ "key": "DETAIL_RECORD_CREATED",
599
+ "name": "Detail Record Created"
600
+ }
601
+ ],
602
+ "transitions": [
603
+ {
604
+ "from": "idle",
605
+ "to": "idle",
606
+ "event": "INIT"
607
+ },
608
+ {
609
+ "from": "idle",
610
+ "to": "idle",
611
+ "event": "DO_CREATE",
612
+ "effects": [
613
+ [
614
+ "persist",
615
+ "create",
616
+ "DetailRecord",
617
+ "@payload.data"
618
+ ],
619
+ [
620
+ "emit",
621
+ "DETAIL_RECORD_CREATED",
622
+ {
623
+ "id": "@payload.data.id"
624
+ }
625
+ ]
626
+ ]
627
+ }
411
628
  ]
412
- }
629
+ },
630
+ "scope": "instance"
413
631
  }
414
632
  ],
415
633
  "pages": [
@@ -425,6 +643,9 @@
425
643
  },
426
644
  {
427
645
  "ref": "DetailRecordView"
646
+ },
647
+ {
648
+ "ref": "DetailRecordPersistor"
428
649
  }
429
650
  ]
430
651
  }