@almadar/std 3.4.3 → 3.5.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.
- package/behaviors/exports/atoms/std-autoregressive.orb +419 -0
- package/behaviors/exports/atoms/std-browse.orb +73 -1
- package/behaviors/exports/atoms/std-circuit-breaker.orb +12 -0
- package/behaviors/exports/atoms/std-combat-log.orb +112 -0
- package/behaviors/exports/atoms/std-confirmation.orb +4 -4
- package/behaviors/exports/atoms/std-game-canvas3d.orb +172 -15
- package/behaviors/exports/atoms/std-modal.orb +2 -2
- package/behaviors/exports/molecules/std-cart.orb +9 -76
- package/behaviors/exports/molecules/std-detail.orb +4 -8
- package/behaviors/exports/molecules/std-geospatial.orb +7 -7
- package/behaviors/exports/molecules/std-inventory.orb +10 -22
- package/behaviors/exports/molecules/std-list.orb +6 -18
- package/behaviors/exports/molecules/std-messaging.orb +4 -8
- package/behaviors/exports/organisms/std-api-gateway.orb +18 -18
- package/behaviors/exports/organisms/std-booking-system.orb +12 -36
- package/behaviors/exports/organisms/std-cicd-pipeline.orb +6 -18
- package/behaviors/exports/organisms/std-cms.orb +16 -44
- package/behaviors/exports/organisms/std-crm.orb +16 -44
- package/behaviors/exports/organisms/std-devops-dashboard.orb +18 -18
- package/behaviors/exports/organisms/std-ecommerce.orb +28 -108
- package/behaviors/exports/organisms/std-finance-tracker.orb +10 -26
- package/behaviors/exports/organisms/std-healthcare.orb +16 -44
- package/behaviors/exports/organisms/std-helpdesk.orb +10 -26
- package/behaviors/exports/organisms/std-hr-portal.orb +12 -36
- package/behaviors/exports/organisms/std-iot-dashboard.orb +18 -18
- package/behaviors/exports/organisms/std-lms.orb +6 -18
- package/behaviors/exports/organisms/std-platformer-app.orb +10 -22
- package/behaviors/exports/organisms/std-project-manager.orb +12 -36
- package/behaviors/exports/organisms/std-realtime-chat.orb +10 -26
- package/behaviors/exports/organisms/std-rpg-game.orb +10 -22
- package/behaviors/exports/organisms/std-service-marketplace.orb +12 -36
- package/behaviors/exports/organisms/std-social-feed.orb +8 -16
- package/behaviors/exports/organisms/std-trading-dashboard.orb +6 -18
- package/behaviors/exports/validation-report.json +2 -3
- package/dist/behaviors/exports/atoms/std-autoregressive.orb +419 -0
- package/dist/behaviors/exports/atoms/std-browse.orb +73 -1
- package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +12 -0
- package/dist/behaviors/exports/atoms/std-combat-log.orb +112 -0
- package/dist/behaviors/exports/atoms/std-confirmation.orb +4 -4
- package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +172 -15
- package/dist/behaviors/exports/atoms/std-modal.orb +2 -2
- package/dist/behaviors/exports/molecules/std-cart.orb +9 -76
- package/dist/behaviors/exports/molecules/std-detail.orb +4 -8
- package/dist/behaviors/exports/molecules/std-geospatial.orb +7 -7
- package/dist/behaviors/exports/molecules/std-inventory.orb +10 -22
- package/dist/behaviors/exports/molecules/std-list.orb +6 -18
- package/dist/behaviors/exports/molecules/std-messaging.orb +4 -8
- package/dist/behaviors/exports/organisms/std-api-gateway.orb +18 -18
- package/dist/behaviors/exports/organisms/std-booking-system.orb +12 -36
- package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +6 -18
- package/dist/behaviors/exports/organisms/std-cms.orb +16 -44
- package/dist/behaviors/exports/organisms/std-crm.orb +16 -44
- package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +18 -18
- package/dist/behaviors/exports/organisms/std-ecommerce.orb +28 -108
- package/dist/behaviors/exports/organisms/std-finance-tracker.orb +10 -26
- package/dist/behaviors/exports/organisms/std-healthcare.orb +16 -44
- package/dist/behaviors/exports/organisms/std-helpdesk.orb +10 -26
- package/dist/behaviors/exports/organisms/std-hr-portal.orb +12 -36
- package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +18 -18
- package/dist/behaviors/exports/organisms/std-lms.orb +6 -18
- package/dist/behaviors/exports/organisms/std-platformer-app.orb +10 -22
- package/dist/behaviors/exports/organisms/std-project-manager.orb +12 -36
- package/dist/behaviors/exports/organisms/std-realtime-chat.orb +10 -26
- package/dist/behaviors/exports/organisms/std-rpg-game.orb +10 -22
- package/dist/behaviors/exports/organisms/std-service-marketplace.orb +12 -36
- package/dist/behaviors/exports/organisms/std-social-feed.orb +8 -16
- package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +6 -18
- package/dist/behaviors/exports/validation-report.json +2 -3
- package/dist/behaviors/functions/index.js +82 -36
- package/dist/behaviors/functions/index.js.map +1 -1
- package/dist/behaviors/index.js +82 -36
- package/dist/behaviors/index.js.map +1 -1
- package/dist/exports/atoms/std-autoregressive.orb +419 -0
- package/dist/exports/atoms/std-browse.orb +73 -1
- package/dist/exports/atoms/std-circuit-breaker.orb +12 -0
- package/dist/exports/atoms/std-combat-log.orb +112 -0
- package/dist/exports/atoms/std-confirmation.orb +4 -4
- package/dist/exports/atoms/std-game-canvas3d.orb +172 -15
- package/dist/exports/atoms/std-modal.orb +2 -2
- package/dist/exports/molecules/std-cart.orb +9 -76
- package/dist/exports/molecules/std-detail.orb +4 -8
- package/dist/exports/molecules/std-geospatial.orb +7 -7
- package/dist/exports/molecules/std-inventory.orb +10 -22
- package/dist/exports/molecules/std-list.orb +6 -18
- package/dist/exports/molecules/std-messaging.orb +4 -8
- package/dist/exports/organisms/std-api-gateway.orb +18 -18
- package/dist/exports/organisms/std-booking-system.orb +12 -36
- package/dist/exports/organisms/std-cicd-pipeline.orb +6 -18
- package/dist/exports/organisms/std-cms.orb +16 -44
- package/dist/exports/organisms/std-crm.orb +16 -44
- package/dist/exports/organisms/std-devops-dashboard.orb +18 -18
- package/dist/exports/organisms/std-ecommerce.orb +28 -108
- package/dist/exports/organisms/std-finance-tracker.orb +10 -26
- package/dist/exports/organisms/std-healthcare.orb +16 -44
- package/dist/exports/organisms/std-helpdesk.orb +10 -26
- package/dist/exports/organisms/std-hr-portal.orb +12 -36
- package/dist/exports/organisms/std-iot-dashboard.orb +18 -18
- package/dist/exports/organisms/std-lms.orb +6 -18
- package/dist/exports/organisms/std-platformer-app.orb +10 -22
- package/dist/exports/organisms/std-project-manager.orb +12 -36
- package/dist/exports/organisms/std-realtime-chat.orb +10 -26
- package/dist/exports/organisms/std-rpg-game.orb +10 -22
- package/dist/exports/organisms/std-service-marketplace.orb +12 -36
- package/dist/exports/organisms/std-social-feed.orb +8 -16
- package/dist/exports/organisms/std-trading-dashboard.orb +6 -18
- package/dist/exports/validation-report.json +2 -3
- package/dist/index.js +82 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -59,7 +59,19 @@ function buildDisplayPattern(c, entityName, emptyTitle, emptyDescription, defaul
|
|
|
59
59
|
return { ...base, ...c.displayProps };
|
|
60
60
|
}
|
|
61
61
|
function buildEntity(c) {
|
|
62
|
-
|
|
62
|
+
const instances = [
|
|
63
|
+
{ id: "bi-1", name: "Terry Schultz", description: "Senior product designer with 8 years of experience", status: "active", createdAt: "2026-01-15" },
|
|
64
|
+
{ id: "bi-2", name: "Dale Franey", description: "Full-stack developer specializing in React and Node.js", status: "active", createdAt: "2026-01-18" },
|
|
65
|
+
{ id: "bi-3", name: "Lorena Mayer", description: "Data analyst focused on business intelligence", status: "pending", createdAt: "2026-01-20" },
|
|
66
|
+
{ id: "bi-4", name: "Andrea Paucek", description: "Project manager with PMP certification", status: "active", createdAt: "2026-02-01" },
|
|
67
|
+
{ id: "bi-5", name: "Geneva Durgan", description: "UX researcher conducting user interviews", status: "inactive", createdAt: "2026-02-05" },
|
|
68
|
+
{ id: "bi-6", name: "Samantha Okuneva", description: "DevOps engineer managing cloud infrastructure", status: "active", createdAt: "2026-02-10" },
|
|
69
|
+
{ id: "bi-7", name: "Nelson Halby", description: "Technical writer documenting APIs", status: "active", createdAt: "2026-02-15" },
|
|
70
|
+
{ id: "bi-8", name: "Tanya Hand", description: "QA lead overseeing test automation", status: "pending", createdAt: "2026-02-20" },
|
|
71
|
+
{ id: "bi-9", name: "Rosemary Lind", description: "Marketing analyst tracking campaign performance", status: "active", createdAt: "2026-03-01" },
|
|
72
|
+
{ id: "bi-10", name: "Bernadette Anderson", description: "Security engineer conducting penetration tests", status: "active", createdAt: "2026-03-05" }
|
|
73
|
+
];
|
|
74
|
+
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence, collection: c.collection, instances });
|
|
63
75
|
}
|
|
64
76
|
function buildTrait(c) {
|
|
65
77
|
const { entityName, listFields, headerIcon, pageTitle, emptyTitle, emptyDescription } = c;
|
|
@@ -181,7 +193,7 @@ function buildTrait(c) {
|
|
|
181
193
|
to: "browsing",
|
|
182
194
|
event: "INIT",
|
|
183
195
|
effects: [
|
|
184
|
-
["
|
|
196
|
+
["ref", entityName],
|
|
185
197
|
["render-ui", "main", {
|
|
186
198
|
type: "stack",
|
|
187
199
|
direction: "vertical",
|
|
@@ -209,7 +221,7 @@ function buildTrait(c) {
|
|
|
209
221
|
from: "browsing",
|
|
210
222
|
to: "browsing",
|
|
211
223
|
event: evt,
|
|
212
|
-
effects: [["
|
|
224
|
+
effects: [["ref", entityName]]
|
|
213
225
|
}))
|
|
214
226
|
]
|
|
215
227
|
}
|
|
@@ -308,7 +320,7 @@ function buildTrait2(c) {
|
|
|
308
320
|
from: "closed",
|
|
309
321
|
to: "closed",
|
|
310
322
|
event: "INIT",
|
|
311
|
-
effects: c.standalone ? [["
|
|
323
|
+
effects: c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
312
324
|
type: "stack",
|
|
313
325
|
direction: "vertical",
|
|
314
326
|
gap: "lg",
|
|
@@ -323,7 +335,7 @@ function buildTrait2(c) {
|
|
|
323
335
|
{ type: "divider" },
|
|
324
336
|
{ type: "empty-state", icon: c.headerIcon, title: "Nothing open", description: "Click Open to view details in a modal overlay." }
|
|
325
337
|
]
|
|
326
|
-
}]] : [["
|
|
338
|
+
}]] : [["ref", c.entityName]]
|
|
327
339
|
},
|
|
328
340
|
// OPEN: closed → open (Modal component in CompiledPortal provides backdrop)
|
|
329
341
|
{
|
|
@@ -336,7 +348,7 @@ function buildTrait2(c) {
|
|
|
336
348
|
{ from: "open", to: "closed", event: c.closeEvent, effects: [
|
|
337
349
|
["render-ui", "modal", null],
|
|
338
350
|
["notify", "Cancelled", "info"],
|
|
339
|
-
...c.standalone ? [["
|
|
351
|
+
...c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
340
352
|
type: "stack",
|
|
341
353
|
direction: "vertical",
|
|
342
354
|
gap: "lg",
|
|
@@ -489,7 +501,7 @@ function buildTrait3(c) {
|
|
|
489
501
|
};
|
|
490
502
|
const dismissAndRefresh = [
|
|
491
503
|
["render-ui", "modal", null],
|
|
492
|
-
...c.standalone ? [["
|
|
504
|
+
...c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
493
505
|
];
|
|
494
506
|
return {
|
|
495
507
|
name: c.traitName,
|
|
@@ -513,7 +525,7 @@ function buildTrait3(c) {
|
|
|
513
525
|
from: "idle",
|
|
514
526
|
to: "idle",
|
|
515
527
|
event: "INIT",
|
|
516
|
-
effects: c.standalone ? [["
|
|
528
|
+
effects: c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
517
529
|
},
|
|
518
530
|
{
|
|
519
531
|
from: "idle",
|
|
@@ -4687,7 +4699,10 @@ function buildEntity23(c) {
|
|
|
4687
4699
|
{ name: "successCount", type: "number", default: 0 },
|
|
4688
4700
|
{ name: "threshold", type: "number", default: 5 }
|
|
4689
4701
|
];
|
|
4690
|
-
|
|
4702
|
+
const instances = [
|
|
4703
|
+
{ id: "sn-1", name: "ServiceNode", description: "Primary API gateway", status: "active", createdAt: "2026-01-10", failureCount: 783, successCount: 603, threshold: 5 }
|
|
4704
|
+
];
|
|
4705
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, collection: c.collection, instances });
|
|
4691
4706
|
}
|
|
4692
4707
|
var ef9 = (field) => ["object/get", ["array/first", "@entity"], field];
|
|
4693
4708
|
function buildTrait24(c) {
|
|
@@ -7482,7 +7497,24 @@ function resolve43(params) {
|
|
|
7482
7497
|
};
|
|
7483
7498
|
}
|
|
7484
7499
|
function buildEntity42(c) {
|
|
7485
|
-
|
|
7500
|
+
const fields = [
|
|
7501
|
+
...c.fields.filter((f) => !["type", "message", "timestamp", "actorName", "targetName", "value", "turn"].includes(f.name)),
|
|
7502
|
+
{ name: "type", type: "string", default: "attack", values: ["attack", "defend", "heal", "move", "special", "death", "spawn"] },
|
|
7503
|
+
{ name: "message", type: "string" },
|
|
7504
|
+
{ name: "timestamp", type: "number", default: 0 },
|
|
7505
|
+
{ name: "actorName", type: "string" },
|
|
7506
|
+
{ name: "targetName", type: "string" },
|
|
7507
|
+
{ name: "value", type: "number", default: 0 },
|
|
7508
|
+
{ name: "turn", type: "number", default: 1 }
|
|
7509
|
+
];
|
|
7510
|
+
const instances = [
|
|
7511
|
+
{ id: "cl-1", name: "Attack log", description: "Warrior attacks Goblin", status: "active", createdAt: "2026-01-01", type: "attack", message: "Warrior strikes Goblin for 25 damage", timestamp: 1e3, actorName: "Warrior", targetName: "Goblin", value: 25, turn: 1 },
|
|
7512
|
+
{ id: "cl-2", name: "Defend log", description: "Paladin raises shield", status: "active", createdAt: "2026-01-01", type: "defend", message: "Paladin raises shield, blocking 15 damage", timestamp: 2e3, actorName: "Paladin", targetName: "Paladin", value: 15, turn: 1 },
|
|
7513
|
+
{ id: "cl-3", name: "Heal log", description: "Cleric heals Warrior", status: "active", createdAt: "2026-01-01", type: "heal", message: "Cleric heals Warrior for 30 HP", timestamp: 3e3, actorName: "Cleric", targetName: "Warrior", value: 30, turn: 2 },
|
|
7514
|
+
{ id: "cl-4", name: "Special log", description: "Mage casts fireball", status: "active", createdAt: "2026-01-01", type: "special", message: "Mage casts Fireball dealing 40 AoE damage", timestamp: 4e3, actorName: "Mage", targetName: "Goblin", value: 40, turn: 2 },
|
|
7515
|
+
{ id: "cl-5", name: "Move log", description: "Rogue moves to flank", status: "active", createdAt: "2026-01-01", type: "move", message: "Rogue moves to flanking position", timestamp: 5e3, actorName: "Rogue", value: 0, turn: 3 }
|
|
7516
|
+
];
|
|
7517
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
7486
7518
|
}
|
|
7487
7519
|
function buildTrait43(c) {
|
|
7488
7520
|
const { entityName, title, maxVisible, autoScroll, showTimestamps } = c;
|
|
@@ -8189,15 +8221,38 @@ function resolve50(params) {
|
|
|
8189
8221
|
};
|
|
8190
8222
|
}
|
|
8191
8223
|
function buildEntity49(c) {
|
|
8192
|
-
|
|
8224
|
+
const fields = [
|
|
8225
|
+
...c.fields.filter((f) => !["tiles", "units", "features"].includes(f.name)),
|
|
8226
|
+
{ name: "tiles", type: "array", default: [] },
|
|
8227
|
+
{ name: "units", type: "array", default: [] },
|
|
8228
|
+
{ name: "features", type: "array", default: [] }
|
|
8229
|
+
];
|
|
8230
|
+
const instances = [
|
|
8231
|
+
{
|
|
8232
|
+
id: "scene-1",
|
|
8233
|
+
name: "Battle Arena",
|
|
8234
|
+
description: "A 3D battle arena",
|
|
8235
|
+
status: "active",
|
|
8236
|
+
createdAt: "2026-01-01",
|
|
8237
|
+
tiles: [
|
|
8238
|
+
{ x: 0, y: 0, z: 0, type: "grass" },
|
|
8239
|
+
{ x: 1, y: 0, z: 0, type: "grass" },
|
|
8240
|
+
{ x: 0, y: 0, z: 1, type: "stone" },
|
|
8241
|
+
{ x: 1, y: 0, z: 1, type: "water" }
|
|
8242
|
+
],
|
|
8243
|
+
units: [],
|
|
8244
|
+
features: []
|
|
8245
|
+
}
|
|
8246
|
+
];
|
|
8247
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
8193
8248
|
}
|
|
8194
8249
|
function buildTrait50(c) {
|
|
8195
8250
|
const { entityName, orientation, cameraMode, showGrid, shadows, backgroundColor } = c;
|
|
8196
8251
|
const canvasView = {
|
|
8197
8252
|
type: "game-canvas3-d",
|
|
8198
|
-
tiles: `@${entityName}
|
|
8199
|
-
units: `@${entityName}
|
|
8200
|
-
features: `@${entityName}
|
|
8253
|
+
tiles: ["object/get", ["array/first", `@${entityName}`], "tiles"],
|
|
8254
|
+
units: ["object/get", ["array/first", `@${entityName}`], "units"],
|
|
8255
|
+
features: ["object/get", ["array/first", `@${entityName}`], "features"],
|
|
8201
8256
|
orientation,
|
|
8202
8257
|
cameraMode,
|
|
8203
8258
|
showGrid,
|
|
@@ -8385,7 +8440,7 @@ function stdList(params) {
|
|
|
8385
8440
|
closeEvent: "CLOSE",
|
|
8386
8441
|
openEffects: [["fetch", entityName]],
|
|
8387
8442
|
saveEvent: "SAVE",
|
|
8388
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8443
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
8389
8444
|
emitOnSave: CREATED
|
|
8390
8445
|
}));
|
|
8391
8446
|
const editTrait = extractTrait(stdModal({
|
|
@@ -8401,7 +8456,7 @@ function stdList(params) {
|
|
|
8401
8456
|
closeEvent: "CLOSE",
|
|
8402
8457
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
8403
8458
|
saveEvent: "SAVE",
|
|
8404
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
8459
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
8405
8460
|
emitOnSave: UPDATED
|
|
8406
8461
|
}));
|
|
8407
8462
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -8454,7 +8509,6 @@ function stdList(params) {
|
|
|
8454
8509
|
{ from: "deleting", to: "browsing", event: "CONFIRM_DELETE", effects: [
|
|
8455
8510
|
["persist", "delete", entityName, "@entity.id"],
|
|
8456
8511
|
["render-ui", "modal", null],
|
|
8457
|
-
["fetch", entityName],
|
|
8458
8512
|
["render-ui", "main", browseMainView]
|
|
8459
8513
|
] },
|
|
8460
8514
|
// CANCEL/CLOSE from deleting (dismiss modal, re-render main)
|
|
@@ -8549,7 +8603,6 @@ function buildCartTrait(c) {
|
|
|
8549
8603
|
name: `${entityName}CartBrowse`,
|
|
8550
8604
|
linkedEntity: entityName,
|
|
8551
8605
|
category: "interaction",
|
|
8552
|
-
listens: [{ event: "CONFIRM_REMOVE", triggers: "CONFIRM_REMOVE" }],
|
|
8553
8606
|
stateMachine: {
|
|
8554
8607
|
states: [
|
|
8555
8608
|
{ name: "browsing", isInitial: true },
|
|
@@ -8558,9 +8611,7 @@ function buildCartTrait(c) {
|
|
|
8558
8611
|
events: [
|
|
8559
8612
|
{ key: "INIT", name: "Initialize" },
|
|
8560
8613
|
{ key: "ADD_ITEM", name: "Add Item" },
|
|
8561
|
-
{ key: "SAVE", name: "Save", payload: [{ name: "data", type: "object", required: true }] },
|
|
8562
8614
|
{ key: "REQUEST_REMOVE", name: "Request Remove", payload: [{ name: "id", type: "string", required: true }] },
|
|
8563
|
-
{ key: "CONFIRM_REMOVE", name: "Confirm Remove", payload: [{ name: "data", type: "object", required: true }] },
|
|
8564
8615
|
{ key: "PROCEED_CHECKOUT", name: "Proceed to Checkout" },
|
|
8565
8616
|
{ key: "BACK_TO_CART", name: "Back to Cart" },
|
|
8566
8617
|
{ key: "CONFIRM_ORDER", name: "Confirm Order" }
|
|
@@ -8568,7 +8619,7 @@ function buildCartTrait(c) {
|
|
|
8568
8619
|
transitions: [
|
|
8569
8620
|
// browsing + INIT (data-grid handles empty vs populated automatically)
|
|
8570
8621
|
{ from: "browsing", to: "browsing", event: "INIT", effects: [
|
|
8571
|
-
["
|
|
8622
|
+
["ref", entityName],
|
|
8572
8623
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
8573
8624
|
headerBar,
|
|
8574
8625
|
{ type: "divider" },
|
|
@@ -8587,13 +8638,9 @@ function buildCartTrait(c) {
|
|
|
8587
8638
|
{ type: "button", label: checkoutButtonLabel, event: "PROCEED_CHECKOUT", variant: "primary", icon: "arrow-right" }
|
|
8588
8639
|
] }]
|
|
8589
8640
|
] },
|
|
8590
|
-
// SAVE: re-fetch after modal adds an item (shared event bus)
|
|
8591
|
-
{ from: "browsing", to: "browsing", event: "SAVE", effects: [["fetch", entityName]] },
|
|
8592
|
-
// CONFIRM_REMOVE: re-fetch after confirmation trait deletes item
|
|
8593
|
-
{ from: "browsing", to: "browsing", event: "CONFIRM_REMOVE", effects: [["fetch", entityName]] },
|
|
8594
8641
|
// PROCEED_CHECKOUT
|
|
8595
8642
|
{ from: "browsing", to: "checkout", event: "PROCEED_CHECKOUT", effects: [
|
|
8596
|
-
["
|
|
8643
|
+
["ref", entityName],
|
|
8597
8644
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
8598
8645
|
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
8599
8646
|
{ type: "icon", name: "clipboard", size: "lg" },
|
|
@@ -8608,10 +8655,10 @@ function buildCartTrait(c) {
|
|
|
8608
8655
|
] }]
|
|
8609
8656
|
] },
|
|
8610
8657
|
// BACK_TO_CART
|
|
8611
|
-
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["
|
|
8658
|
+
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["ref", entityName]] },
|
|
8612
8659
|
// CONFIRM_ORDER
|
|
8613
8660
|
{ from: "checkout", to: "browsing", event: "CONFIRM_ORDER", effects: [
|
|
8614
|
-
["
|
|
8661
|
+
["ref", entityName],
|
|
8615
8662
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [
|
|
8616
8663
|
{ type: "icon", name: "check-circle", size: "lg" },
|
|
8617
8664
|
{ type: "typography", content: "Order Confirmed", variant: "h2" },
|
|
@@ -8667,7 +8714,7 @@ function stdCart(params) {
|
|
|
8667
8714
|
closeEvent: "CLOSE",
|
|
8668
8715
|
openEffects: [["fetch", entityName]],
|
|
8669
8716
|
saveEvent: "SAVE",
|
|
8670
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8717
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]]
|
|
8671
8718
|
}));
|
|
8672
8719
|
const removeTrait = extractTrait(stdConfirmation({
|
|
8673
8720
|
standalone: false,
|
|
@@ -8680,8 +8727,7 @@ function stdCart(params) {
|
|
|
8680
8727
|
headerIcon: "trash-2",
|
|
8681
8728
|
requestEvent: "REQUEST_REMOVE",
|
|
8682
8729
|
confirmEvent: "CONFIRM_REMOVE",
|
|
8683
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
8684
|
-
emitOnConfirm: "CONFIRM_REMOVE"
|
|
8730
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]]
|
|
8685
8731
|
}));
|
|
8686
8732
|
const removeSm = removeTrait.stateMachine;
|
|
8687
8733
|
if (removeSm && "events" in removeSm) {
|
|
@@ -8791,7 +8837,7 @@ function stdDetail(params) {
|
|
|
8791
8837
|
closeEvent: "CLOSE",
|
|
8792
8838
|
openEffects: [["fetch", entityName]],
|
|
8793
8839
|
saveEvent: "SAVE",
|
|
8794
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8840
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
8795
8841
|
emitOnSave: "SAVE"
|
|
8796
8842
|
}));
|
|
8797
8843
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -8958,7 +9004,7 @@ function stdInventory(params) {
|
|
|
8958
9004
|
closeEvent: "CLOSE",
|
|
8959
9005
|
openEffects: [["fetch", entityName]],
|
|
8960
9006
|
saveEvent: "SAVE",
|
|
8961
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
9007
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
8962
9008
|
emitOnSave: "ITEM_ADDED"
|
|
8963
9009
|
}));
|
|
8964
9010
|
const useTrait = extractTrait(stdModal({
|
|
@@ -8974,7 +9020,7 @@ function stdInventory(params) {
|
|
|
8974
9020
|
closeEvent: "CLOSE",
|
|
8975
9021
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
8976
9022
|
saveEvent: "SAVE",
|
|
8977
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
9023
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
8978
9024
|
emitOnSave: "ITEM_USED"
|
|
8979
9025
|
}));
|
|
8980
9026
|
const dropTrait = extractTrait(stdConfirmation({
|
|
@@ -8988,7 +9034,7 @@ function stdInventory(params) {
|
|
|
8988
9034
|
headerIcon: "trash-2",
|
|
8989
9035
|
requestEvent: "DROP",
|
|
8990
9036
|
confirmEvent: "CONFIRM_DROP",
|
|
8991
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
9037
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]],
|
|
8992
9038
|
emitOnConfirm: "CONFIRM_DROP"
|
|
8993
9039
|
}));
|
|
8994
9040
|
const dropSm = dropTrait.stateMachine;
|
|
@@ -9144,7 +9190,7 @@ function stdMessaging(params) {
|
|
|
9144
9190
|
openEvent: "COMPOSE",
|
|
9145
9191
|
closeEvent: "CLOSE",
|
|
9146
9192
|
saveEvent: "SEND",
|
|
9147
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
9193
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
9148
9194
|
emitOnSave: "SEND"
|
|
9149
9195
|
}));
|
|
9150
9196
|
const viewTrait = extractTrait(stdModal({
|