@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
package/dist/behaviors/index.js
CHANGED
|
@@ -186,7 +186,19 @@ function buildDisplayPattern(c, entityName, emptyTitle, emptyDescription, defaul
|
|
|
186
186
|
return { ...base, ...c.displayProps };
|
|
187
187
|
}
|
|
188
188
|
function buildEntity(c) {
|
|
189
|
-
|
|
189
|
+
const instances = [
|
|
190
|
+
{ id: "bi-1", name: "Terry Schultz", description: "Senior product designer with 8 years of experience", status: "active", createdAt: "2026-01-15" },
|
|
191
|
+
{ id: "bi-2", name: "Dale Franey", description: "Full-stack developer specializing in React and Node.js", status: "active", createdAt: "2026-01-18" },
|
|
192
|
+
{ id: "bi-3", name: "Lorena Mayer", description: "Data analyst focused on business intelligence", status: "pending", createdAt: "2026-01-20" },
|
|
193
|
+
{ id: "bi-4", name: "Andrea Paucek", description: "Project manager with PMP certification", status: "active", createdAt: "2026-02-01" },
|
|
194
|
+
{ id: "bi-5", name: "Geneva Durgan", description: "UX researcher conducting user interviews", status: "inactive", createdAt: "2026-02-05" },
|
|
195
|
+
{ id: "bi-6", name: "Samantha Okuneva", description: "DevOps engineer managing cloud infrastructure", status: "active", createdAt: "2026-02-10" },
|
|
196
|
+
{ id: "bi-7", name: "Nelson Halby", description: "Technical writer documenting APIs", status: "active", createdAt: "2026-02-15" },
|
|
197
|
+
{ id: "bi-8", name: "Tanya Hand", description: "QA lead overseeing test automation", status: "pending", createdAt: "2026-02-20" },
|
|
198
|
+
{ id: "bi-9", name: "Rosemary Lind", description: "Marketing analyst tracking campaign performance", status: "active", createdAt: "2026-03-01" },
|
|
199
|
+
{ id: "bi-10", name: "Bernadette Anderson", description: "Security engineer conducting penetration tests", status: "active", createdAt: "2026-03-05" }
|
|
200
|
+
];
|
|
201
|
+
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence, collection: c.collection, instances });
|
|
190
202
|
}
|
|
191
203
|
function buildTrait(c) {
|
|
192
204
|
const { entityName, listFields, headerIcon, pageTitle, emptyTitle, emptyDescription } = c;
|
|
@@ -308,7 +320,7 @@ function buildTrait(c) {
|
|
|
308
320
|
to: "browsing",
|
|
309
321
|
event: "INIT",
|
|
310
322
|
effects: [
|
|
311
|
-
["
|
|
323
|
+
["ref", entityName],
|
|
312
324
|
["render-ui", "main", {
|
|
313
325
|
type: "stack",
|
|
314
326
|
direction: "vertical",
|
|
@@ -336,7 +348,7 @@ function buildTrait(c) {
|
|
|
336
348
|
from: "browsing",
|
|
337
349
|
to: "browsing",
|
|
338
350
|
event: evt,
|
|
339
|
-
effects: [["
|
|
351
|
+
effects: [["ref", entityName]]
|
|
340
352
|
}))
|
|
341
353
|
]
|
|
342
354
|
}
|
|
@@ -435,7 +447,7 @@ function buildTrait2(c) {
|
|
|
435
447
|
from: "closed",
|
|
436
448
|
to: "closed",
|
|
437
449
|
event: "INIT",
|
|
438
|
-
effects: c.standalone ? [["
|
|
450
|
+
effects: c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
439
451
|
type: "stack",
|
|
440
452
|
direction: "vertical",
|
|
441
453
|
gap: "lg",
|
|
@@ -450,7 +462,7 @@ function buildTrait2(c) {
|
|
|
450
462
|
{ type: "divider" },
|
|
451
463
|
{ type: "empty-state", icon: c.headerIcon, title: "Nothing open", description: "Click Open to view details in a modal overlay." }
|
|
452
464
|
]
|
|
453
|
-
}]] : [["
|
|
465
|
+
}]] : [["ref", c.entityName]]
|
|
454
466
|
},
|
|
455
467
|
// OPEN: closed → open (Modal component in CompiledPortal provides backdrop)
|
|
456
468
|
{
|
|
@@ -463,7 +475,7 @@ function buildTrait2(c) {
|
|
|
463
475
|
{ from: "open", to: "closed", event: c.closeEvent, effects: [
|
|
464
476
|
["render-ui", "modal", null],
|
|
465
477
|
["notify", "Cancelled", "info"],
|
|
466
|
-
...c.standalone ? [["
|
|
478
|
+
...c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
467
479
|
type: "stack",
|
|
468
480
|
direction: "vertical",
|
|
469
481
|
gap: "lg",
|
|
@@ -616,7 +628,7 @@ function buildTrait3(c) {
|
|
|
616
628
|
};
|
|
617
629
|
const dismissAndRefresh = [
|
|
618
630
|
["render-ui", "modal", null],
|
|
619
|
-
...c.standalone ? [["
|
|
631
|
+
...c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
620
632
|
];
|
|
621
633
|
return {
|
|
622
634
|
name: c.traitName,
|
|
@@ -640,7 +652,7 @@ function buildTrait3(c) {
|
|
|
640
652
|
from: "idle",
|
|
641
653
|
to: "idle",
|
|
642
654
|
event: "INIT",
|
|
643
|
-
effects: c.standalone ? [["
|
|
655
|
+
effects: c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
644
656
|
},
|
|
645
657
|
{
|
|
646
658
|
from: "idle",
|
|
@@ -4814,7 +4826,10 @@ function buildEntity23(c) {
|
|
|
4814
4826
|
{ name: "successCount", type: "number", default: 0 },
|
|
4815
4827
|
{ name: "threshold", type: "number", default: 5 }
|
|
4816
4828
|
];
|
|
4817
|
-
|
|
4829
|
+
const instances = [
|
|
4830
|
+
{ id: "sn-1", name: "ServiceNode", description: "Primary API gateway", status: "active", createdAt: "2026-01-10", failureCount: 783, successCount: 603, threshold: 5 }
|
|
4831
|
+
];
|
|
4832
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, collection: c.collection, instances });
|
|
4818
4833
|
}
|
|
4819
4834
|
var ef9 = (field) => ["object/get", ["array/first", "@entity"], field];
|
|
4820
4835
|
function buildTrait24(c) {
|
|
@@ -7609,7 +7624,24 @@ function resolve44(params) {
|
|
|
7609
7624
|
};
|
|
7610
7625
|
}
|
|
7611
7626
|
function buildEntity42(c) {
|
|
7612
|
-
|
|
7627
|
+
const fields = [
|
|
7628
|
+
...c.fields.filter((f) => !["type", "message", "timestamp", "actorName", "targetName", "value", "turn"].includes(f.name)),
|
|
7629
|
+
{ name: "type", type: "string", default: "attack", values: ["attack", "defend", "heal", "move", "special", "death", "spawn"] },
|
|
7630
|
+
{ name: "message", type: "string" },
|
|
7631
|
+
{ name: "timestamp", type: "number", default: 0 },
|
|
7632
|
+
{ name: "actorName", type: "string" },
|
|
7633
|
+
{ name: "targetName", type: "string" },
|
|
7634
|
+
{ name: "value", type: "number", default: 0 },
|
|
7635
|
+
{ name: "turn", type: "number", default: 1 }
|
|
7636
|
+
];
|
|
7637
|
+
const instances = [
|
|
7638
|
+
{ 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 },
|
|
7639
|
+
{ 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 },
|
|
7640
|
+
{ 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 },
|
|
7641
|
+
{ 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 },
|
|
7642
|
+
{ 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 }
|
|
7643
|
+
];
|
|
7644
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
7613
7645
|
}
|
|
7614
7646
|
function buildTrait43(c) {
|
|
7615
7647
|
const { entityName, title, maxVisible, autoScroll, showTimestamps } = c;
|
|
@@ -8316,15 +8348,38 @@ function resolve51(params) {
|
|
|
8316
8348
|
};
|
|
8317
8349
|
}
|
|
8318
8350
|
function buildEntity49(c) {
|
|
8319
|
-
|
|
8351
|
+
const fields = [
|
|
8352
|
+
...c.fields.filter((f) => !["tiles", "units", "features"].includes(f.name)),
|
|
8353
|
+
{ name: "tiles", type: "array", default: [] },
|
|
8354
|
+
{ name: "units", type: "array", default: [] },
|
|
8355
|
+
{ name: "features", type: "array", default: [] }
|
|
8356
|
+
];
|
|
8357
|
+
const instances = [
|
|
8358
|
+
{
|
|
8359
|
+
id: "scene-1",
|
|
8360
|
+
name: "Battle Arena",
|
|
8361
|
+
description: "A 3D battle arena",
|
|
8362
|
+
status: "active",
|
|
8363
|
+
createdAt: "2026-01-01",
|
|
8364
|
+
tiles: [
|
|
8365
|
+
{ x: 0, y: 0, z: 0, type: "grass" },
|
|
8366
|
+
{ x: 1, y: 0, z: 0, type: "grass" },
|
|
8367
|
+
{ x: 0, y: 0, z: 1, type: "stone" },
|
|
8368
|
+
{ x: 1, y: 0, z: 1, type: "water" }
|
|
8369
|
+
],
|
|
8370
|
+
units: [],
|
|
8371
|
+
features: []
|
|
8372
|
+
}
|
|
8373
|
+
];
|
|
8374
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
8320
8375
|
}
|
|
8321
8376
|
function buildTrait50(c) {
|
|
8322
8377
|
const { entityName, orientation, cameraMode, showGrid, shadows, backgroundColor } = c;
|
|
8323
8378
|
const canvasView = {
|
|
8324
8379
|
type: "game-canvas3-d",
|
|
8325
|
-
tiles: `@${entityName}
|
|
8326
|
-
units: `@${entityName}
|
|
8327
|
-
features: `@${entityName}
|
|
8380
|
+
tiles: ["object/get", ["array/first", `@${entityName}`], "tiles"],
|
|
8381
|
+
units: ["object/get", ["array/first", `@${entityName}`], "units"],
|
|
8382
|
+
features: ["object/get", ["array/first", `@${entityName}`], "features"],
|
|
8328
8383
|
orientation,
|
|
8329
8384
|
cameraMode,
|
|
8330
8385
|
showGrid,
|
|
@@ -8512,7 +8567,7 @@ function stdList(params) {
|
|
|
8512
8567
|
closeEvent: "CLOSE",
|
|
8513
8568
|
openEffects: [["fetch", entityName]],
|
|
8514
8569
|
saveEvent: "SAVE",
|
|
8515
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8570
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
8516
8571
|
emitOnSave: CREATED
|
|
8517
8572
|
}));
|
|
8518
8573
|
const editTrait = extractTrait(stdModal({
|
|
@@ -8528,7 +8583,7 @@ function stdList(params) {
|
|
|
8528
8583
|
closeEvent: "CLOSE",
|
|
8529
8584
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
8530
8585
|
saveEvent: "SAVE",
|
|
8531
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
8586
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
8532
8587
|
emitOnSave: UPDATED
|
|
8533
8588
|
}));
|
|
8534
8589
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -8581,7 +8636,6 @@ function stdList(params) {
|
|
|
8581
8636
|
{ from: "deleting", to: "browsing", event: "CONFIRM_DELETE", effects: [
|
|
8582
8637
|
["persist", "delete", entityName, "@entity.id"],
|
|
8583
8638
|
["render-ui", "modal", null],
|
|
8584
|
-
["fetch", entityName],
|
|
8585
8639
|
["render-ui", "main", browseMainView]
|
|
8586
8640
|
] },
|
|
8587
8641
|
// CANCEL/CLOSE from deleting (dismiss modal, re-render main)
|
|
@@ -8676,7 +8730,6 @@ function buildCartTrait(c) {
|
|
|
8676
8730
|
name: `${entityName}CartBrowse`,
|
|
8677
8731
|
linkedEntity: entityName,
|
|
8678
8732
|
category: "interaction",
|
|
8679
|
-
listens: [{ event: "CONFIRM_REMOVE", triggers: "CONFIRM_REMOVE" }],
|
|
8680
8733
|
stateMachine: {
|
|
8681
8734
|
states: [
|
|
8682
8735
|
{ name: "browsing", isInitial: true },
|
|
@@ -8685,9 +8738,7 @@ function buildCartTrait(c) {
|
|
|
8685
8738
|
events: [
|
|
8686
8739
|
{ key: "INIT", name: "Initialize" },
|
|
8687
8740
|
{ key: "ADD_ITEM", name: "Add Item" },
|
|
8688
|
-
{ key: "SAVE", name: "Save", payload: [{ name: "data", type: "object", required: true }] },
|
|
8689
8741
|
{ key: "REQUEST_REMOVE", name: "Request Remove", payload: [{ name: "id", type: "string", required: true }] },
|
|
8690
|
-
{ key: "CONFIRM_REMOVE", name: "Confirm Remove", payload: [{ name: "data", type: "object", required: true }] },
|
|
8691
8742
|
{ key: "PROCEED_CHECKOUT", name: "Proceed to Checkout" },
|
|
8692
8743
|
{ key: "BACK_TO_CART", name: "Back to Cart" },
|
|
8693
8744
|
{ key: "CONFIRM_ORDER", name: "Confirm Order" }
|
|
@@ -8695,7 +8746,7 @@ function buildCartTrait(c) {
|
|
|
8695
8746
|
transitions: [
|
|
8696
8747
|
// browsing + INIT (data-grid handles empty vs populated automatically)
|
|
8697
8748
|
{ from: "browsing", to: "browsing", event: "INIT", effects: [
|
|
8698
|
-
["
|
|
8749
|
+
["ref", entityName],
|
|
8699
8750
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
8700
8751
|
headerBar,
|
|
8701
8752
|
{ type: "divider" },
|
|
@@ -8714,13 +8765,9 @@ function buildCartTrait(c) {
|
|
|
8714
8765
|
{ type: "button", label: checkoutButtonLabel, event: "PROCEED_CHECKOUT", variant: "primary", icon: "arrow-right" }
|
|
8715
8766
|
] }]
|
|
8716
8767
|
] },
|
|
8717
|
-
// SAVE: re-fetch after modal adds an item (shared event bus)
|
|
8718
|
-
{ from: "browsing", to: "browsing", event: "SAVE", effects: [["fetch", entityName]] },
|
|
8719
|
-
// CONFIRM_REMOVE: re-fetch after confirmation trait deletes item
|
|
8720
|
-
{ from: "browsing", to: "browsing", event: "CONFIRM_REMOVE", effects: [["fetch", entityName]] },
|
|
8721
8768
|
// PROCEED_CHECKOUT
|
|
8722
8769
|
{ from: "browsing", to: "checkout", event: "PROCEED_CHECKOUT", effects: [
|
|
8723
|
-
["
|
|
8770
|
+
["ref", entityName],
|
|
8724
8771
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
8725
8772
|
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
8726
8773
|
{ type: "icon", name: "clipboard", size: "lg" },
|
|
@@ -8735,10 +8782,10 @@ function buildCartTrait(c) {
|
|
|
8735
8782
|
] }]
|
|
8736
8783
|
] },
|
|
8737
8784
|
// BACK_TO_CART
|
|
8738
|
-
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["
|
|
8785
|
+
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["ref", entityName]] },
|
|
8739
8786
|
// CONFIRM_ORDER
|
|
8740
8787
|
{ from: "checkout", to: "browsing", event: "CONFIRM_ORDER", effects: [
|
|
8741
|
-
["
|
|
8788
|
+
["ref", entityName],
|
|
8742
8789
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [
|
|
8743
8790
|
{ type: "icon", name: "check-circle", size: "lg" },
|
|
8744
8791
|
{ type: "typography", content: "Order Confirmed", variant: "h2" },
|
|
@@ -8794,7 +8841,7 @@ function stdCart(params) {
|
|
|
8794
8841
|
closeEvent: "CLOSE",
|
|
8795
8842
|
openEffects: [["fetch", entityName]],
|
|
8796
8843
|
saveEvent: "SAVE",
|
|
8797
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8844
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]]
|
|
8798
8845
|
}));
|
|
8799
8846
|
const removeTrait = extractTrait(stdConfirmation({
|
|
8800
8847
|
standalone: false,
|
|
@@ -8807,8 +8854,7 @@ function stdCart(params) {
|
|
|
8807
8854
|
headerIcon: "trash-2",
|
|
8808
8855
|
requestEvent: "REQUEST_REMOVE",
|
|
8809
8856
|
confirmEvent: "CONFIRM_REMOVE",
|
|
8810
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
8811
|
-
emitOnConfirm: "CONFIRM_REMOVE"
|
|
8857
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]]
|
|
8812
8858
|
}));
|
|
8813
8859
|
const removeSm = removeTrait.stateMachine;
|
|
8814
8860
|
if (removeSm && "events" in removeSm) {
|
|
@@ -8918,7 +8964,7 @@ function stdDetail(params) {
|
|
|
8918
8964
|
closeEvent: "CLOSE",
|
|
8919
8965
|
openEffects: [["fetch", entityName]],
|
|
8920
8966
|
saveEvent: "SAVE",
|
|
8921
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
8967
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
8922
8968
|
emitOnSave: "SAVE"
|
|
8923
8969
|
}));
|
|
8924
8970
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -9085,7 +9131,7 @@ function stdInventory(params) {
|
|
|
9085
9131
|
closeEvent: "CLOSE",
|
|
9086
9132
|
openEffects: [["fetch", entityName]],
|
|
9087
9133
|
saveEvent: "SAVE",
|
|
9088
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
9134
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
9089
9135
|
emitOnSave: "ITEM_ADDED"
|
|
9090
9136
|
}));
|
|
9091
9137
|
const useTrait = extractTrait(stdModal({
|
|
@@ -9101,7 +9147,7 @@ function stdInventory(params) {
|
|
|
9101
9147
|
closeEvent: "CLOSE",
|
|
9102
9148
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
9103
9149
|
saveEvent: "SAVE",
|
|
9104
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
9150
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
9105
9151
|
emitOnSave: "ITEM_USED"
|
|
9106
9152
|
}));
|
|
9107
9153
|
const dropTrait = extractTrait(stdConfirmation({
|
|
@@ -9115,7 +9161,7 @@ function stdInventory(params) {
|
|
|
9115
9161
|
headerIcon: "trash-2",
|
|
9116
9162
|
requestEvent: "DROP",
|
|
9117
9163
|
confirmEvent: "CONFIRM_DROP",
|
|
9118
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
9164
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]],
|
|
9119
9165
|
emitOnConfirm: "CONFIRM_DROP"
|
|
9120
9166
|
}));
|
|
9121
9167
|
const dropSm = dropTrait.stateMachine;
|
|
@@ -9271,7 +9317,7 @@ function stdMessaging(params) {
|
|
|
9271
9317
|
openEvent: "COMPOSE",
|
|
9272
9318
|
closeEvent: "CLOSE",
|
|
9273
9319
|
saveEvent: "SEND",
|
|
9274
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
9320
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
9275
9321
|
emitOnSave: "SEND"
|
|
9276
9322
|
}));
|
|
9277
9323
|
const viewTrait = extractTrait(stdModal({
|