@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/index.js
CHANGED
|
@@ -3824,7 +3824,19 @@ function buildDisplayPattern(c, entityName, emptyTitle, emptyDescription, defaul
|
|
|
3824
3824
|
return { ...base, ...c.displayProps };
|
|
3825
3825
|
}
|
|
3826
3826
|
function buildEntity(c) {
|
|
3827
|
-
|
|
3827
|
+
const instances = [
|
|
3828
|
+
{ id: "bi-1", name: "Terry Schultz", description: "Senior product designer with 8 years of experience", status: "active", createdAt: "2026-01-15" },
|
|
3829
|
+
{ id: "bi-2", name: "Dale Franey", description: "Full-stack developer specializing in React and Node.js", status: "active", createdAt: "2026-01-18" },
|
|
3830
|
+
{ id: "bi-3", name: "Lorena Mayer", description: "Data analyst focused on business intelligence", status: "pending", createdAt: "2026-01-20" },
|
|
3831
|
+
{ id: "bi-4", name: "Andrea Paucek", description: "Project manager with PMP certification", status: "active", createdAt: "2026-02-01" },
|
|
3832
|
+
{ id: "bi-5", name: "Geneva Durgan", description: "UX researcher conducting user interviews", status: "inactive", createdAt: "2026-02-05" },
|
|
3833
|
+
{ id: "bi-6", name: "Samantha Okuneva", description: "DevOps engineer managing cloud infrastructure", status: "active", createdAt: "2026-02-10" },
|
|
3834
|
+
{ id: "bi-7", name: "Nelson Halby", description: "Technical writer documenting APIs", status: "active", createdAt: "2026-02-15" },
|
|
3835
|
+
{ id: "bi-8", name: "Tanya Hand", description: "QA lead overseeing test automation", status: "pending", createdAt: "2026-02-20" },
|
|
3836
|
+
{ id: "bi-9", name: "Rosemary Lind", description: "Marketing analyst tracking campaign performance", status: "active", createdAt: "2026-03-01" },
|
|
3837
|
+
{ id: "bi-10", name: "Bernadette Anderson", description: "Security engineer conducting penetration tests", status: "active", createdAt: "2026-03-05" }
|
|
3838
|
+
];
|
|
3839
|
+
return makeEntity({ name: c.entityName, fields: c.fields, persistence: c.persistence, collection: c.collection, instances });
|
|
3828
3840
|
}
|
|
3829
3841
|
function buildTrait(c) {
|
|
3830
3842
|
const { entityName, listFields, headerIcon, pageTitle, emptyTitle, emptyDescription } = c;
|
|
@@ -3946,7 +3958,7 @@ function buildTrait(c) {
|
|
|
3946
3958
|
to: "browsing",
|
|
3947
3959
|
event: "INIT",
|
|
3948
3960
|
effects: [
|
|
3949
|
-
["
|
|
3961
|
+
["ref", entityName],
|
|
3950
3962
|
["render-ui", "main", {
|
|
3951
3963
|
type: "stack",
|
|
3952
3964
|
direction: "vertical",
|
|
@@ -3974,7 +3986,7 @@ function buildTrait(c) {
|
|
|
3974
3986
|
from: "browsing",
|
|
3975
3987
|
to: "browsing",
|
|
3976
3988
|
event: evt,
|
|
3977
|
-
effects: [["
|
|
3989
|
+
effects: [["ref", entityName]]
|
|
3978
3990
|
}))
|
|
3979
3991
|
]
|
|
3980
3992
|
}
|
|
@@ -4073,7 +4085,7 @@ function buildTrait2(c) {
|
|
|
4073
4085
|
from: "closed",
|
|
4074
4086
|
to: "closed",
|
|
4075
4087
|
event: "INIT",
|
|
4076
|
-
effects: c.standalone ? [["
|
|
4088
|
+
effects: c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
4077
4089
|
type: "stack",
|
|
4078
4090
|
direction: "vertical",
|
|
4079
4091
|
gap: "lg",
|
|
@@ -4088,7 +4100,7 @@ function buildTrait2(c) {
|
|
|
4088
4100
|
{ type: "divider" },
|
|
4089
4101
|
{ type: "empty-state", icon: c.headerIcon, title: "Nothing open", description: "Click Open to view details in a modal overlay." }
|
|
4090
4102
|
]
|
|
4091
|
-
}]] : [["
|
|
4103
|
+
}]] : [["ref", c.entityName]]
|
|
4092
4104
|
},
|
|
4093
4105
|
// OPEN: closed → open (Modal component in CompiledPortal provides backdrop)
|
|
4094
4106
|
{
|
|
@@ -4101,7 +4113,7 @@ function buildTrait2(c) {
|
|
|
4101
4113
|
{ from: "open", to: "closed", event: c.closeEvent, effects: [
|
|
4102
4114
|
["render-ui", "modal", null],
|
|
4103
4115
|
["notify", "Cancelled", "info"],
|
|
4104
|
-
...c.standalone ? [["
|
|
4116
|
+
...c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
|
|
4105
4117
|
type: "stack",
|
|
4106
4118
|
direction: "vertical",
|
|
4107
4119
|
gap: "lg",
|
|
@@ -4254,7 +4266,7 @@ function buildTrait3(c) {
|
|
|
4254
4266
|
};
|
|
4255
4267
|
const dismissAndRefresh = [
|
|
4256
4268
|
["render-ui", "modal", null],
|
|
4257
|
-
...c.standalone ? [["
|
|
4269
|
+
...c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
4258
4270
|
];
|
|
4259
4271
|
return {
|
|
4260
4272
|
name: c.traitName,
|
|
@@ -4278,7 +4290,7 @@ function buildTrait3(c) {
|
|
|
4278
4290
|
from: "idle",
|
|
4279
4291
|
to: "idle",
|
|
4280
4292
|
event: "INIT",
|
|
4281
|
-
effects: c.standalone ? [["
|
|
4293
|
+
effects: c.standalone ? [["ref", entityName], ["render-ui", "main", idleMainView]] : [["ref", entityName]]
|
|
4282
4294
|
},
|
|
4283
4295
|
{
|
|
4284
4296
|
from: "idle",
|
|
@@ -8452,7 +8464,10 @@ function buildEntity23(c) {
|
|
|
8452
8464
|
{ name: "successCount", type: "number", default: 0 },
|
|
8453
8465
|
{ name: "threshold", type: "number", default: 5 }
|
|
8454
8466
|
];
|
|
8455
|
-
|
|
8467
|
+
const instances = [
|
|
8468
|
+
{ id: "sn-1", name: "ServiceNode", description: "Primary API gateway", status: "active", createdAt: "2026-01-10", failureCount: 783, successCount: 603, threshold: 5 }
|
|
8469
|
+
];
|
|
8470
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, collection: c.collection, instances });
|
|
8456
8471
|
}
|
|
8457
8472
|
var ef9 = (field) => ["object/get", ["array/first", "@entity"], field];
|
|
8458
8473
|
function buildTrait24(c) {
|
|
@@ -11247,7 +11262,24 @@ function resolve44(params) {
|
|
|
11247
11262
|
};
|
|
11248
11263
|
}
|
|
11249
11264
|
function buildEntity42(c) {
|
|
11250
|
-
|
|
11265
|
+
const fields = [
|
|
11266
|
+
...c.fields.filter((f) => !["type", "message", "timestamp", "actorName", "targetName", "value", "turn"].includes(f.name)),
|
|
11267
|
+
{ name: "type", type: "string", default: "attack", values: ["attack", "defend", "heal", "move", "special", "death", "spawn"] },
|
|
11268
|
+
{ name: "message", type: "string" },
|
|
11269
|
+
{ name: "timestamp", type: "number", default: 0 },
|
|
11270
|
+
{ name: "actorName", type: "string" },
|
|
11271
|
+
{ name: "targetName", type: "string" },
|
|
11272
|
+
{ name: "value", type: "number", default: 0 },
|
|
11273
|
+
{ name: "turn", type: "number", default: 1 }
|
|
11274
|
+
];
|
|
11275
|
+
const instances = [
|
|
11276
|
+
{ 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 },
|
|
11277
|
+
{ 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 },
|
|
11278
|
+
{ 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 },
|
|
11279
|
+
{ 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 },
|
|
11280
|
+
{ 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 }
|
|
11281
|
+
];
|
|
11282
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
11251
11283
|
}
|
|
11252
11284
|
function buildTrait43(c) {
|
|
11253
11285
|
const { entityName, title, maxVisible, autoScroll, showTimestamps } = c;
|
|
@@ -11954,15 +11986,38 @@ function resolve51(params) {
|
|
|
11954
11986
|
};
|
|
11955
11987
|
}
|
|
11956
11988
|
function buildEntity49(c) {
|
|
11957
|
-
|
|
11989
|
+
const fields = [
|
|
11990
|
+
...c.fields.filter((f) => !["tiles", "units", "features"].includes(f.name)),
|
|
11991
|
+
{ name: "tiles", type: "array", default: [] },
|
|
11992
|
+
{ name: "units", type: "array", default: [] },
|
|
11993
|
+
{ name: "features", type: "array", default: [] }
|
|
11994
|
+
];
|
|
11995
|
+
const instances = [
|
|
11996
|
+
{
|
|
11997
|
+
id: "scene-1",
|
|
11998
|
+
name: "Battle Arena",
|
|
11999
|
+
description: "A 3D battle arena",
|
|
12000
|
+
status: "active",
|
|
12001
|
+
createdAt: "2026-01-01",
|
|
12002
|
+
tiles: [
|
|
12003
|
+
{ x: 0, y: 0, z: 0, type: "grass" },
|
|
12004
|
+
{ x: 1, y: 0, z: 0, type: "grass" },
|
|
12005
|
+
{ x: 0, y: 0, z: 1, type: "stone" },
|
|
12006
|
+
{ x: 1, y: 0, z: 1, type: "water" }
|
|
12007
|
+
],
|
|
12008
|
+
units: [],
|
|
12009
|
+
features: []
|
|
12010
|
+
}
|
|
12011
|
+
];
|
|
12012
|
+
return makeEntity({ name: c.entityName, fields, persistence: c.persistence, instances });
|
|
11958
12013
|
}
|
|
11959
12014
|
function buildTrait50(c) {
|
|
11960
12015
|
const { entityName, orientation, cameraMode, showGrid, shadows, backgroundColor } = c;
|
|
11961
12016
|
const canvasView = {
|
|
11962
12017
|
type: "game-canvas3-d",
|
|
11963
|
-
tiles: `@${entityName}
|
|
11964
|
-
units: `@${entityName}
|
|
11965
|
-
features: `@${entityName}
|
|
12018
|
+
tiles: ["object/get", ["array/first", `@${entityName}`], "tiles"],
|
|
12019
|
+
units: ["object/get", ["array/first", `@${entityName}`], "units"],
|
|
12020
|
+
features: ["object/get", ["array/first", `@${entityName}`], "features"],
|
|
11966
12021
|
orientation,
|
|
11967
12022
|
cameraMode,
|
|
11968
12023
|
showGrid,
|
|
@@ -12150,7 +12205,7 @@ function stdList(params) {
|
|
|
12150
12205
|
closeEvent: "CLOSE",
|
|
12151
12206
|
openEffects: [["fetch", entityName]],
|
|
12152
12207
|
saveEvent: "SAVE",
|
|
12153
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
12208
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
12154
12209
|
emitOnSave: CREATED
|
|
12155
12210
|
}));
|
|
12156
12211
|
const editTrait = extractTrait(stdModal({
|
|
@@ -12166,7 +12221,7 @@ function stdList(params) {
|
|
|
12166
12221
|
closeEvent: "CLOSE",
|
|
12167
12222
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
12168
12223
|
saveEvent: "SAVE",
|
|
12169
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
12224
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
12170
12225
|
emitOnSave: UPDATED
|
|
12171
12226
|
}));
|
|
12172
12227
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -12219,7 +12274,6 @@ function stdList(params) {
|
|
|
12219
12274
|
{ from: "deleting", to: "browsing", event: "CONFIRM_DELETE", effects: [
|
|
12220
12275
|
["persist", "delete", entityName, "@entity.id"],
|
|
12221
12276
|
["render-ui", "modal", null],
|
|
12222
|
-
["fetch", entityName],
|
|
12223
12277
|
["render-ui", "main", browseMainView]
|
|
12224
12278
|
] },
|
|
12225
12279
|
// CANCEL/CLOSE from deleting (dismiss modal, re-render main)
|
|
@@ -12314,7 +12368,6 @@ function buildCartTrait(c) {
|
|
|
12314
12368
|
name: `${entityName}CartBrowse`,
|
|
12315
12369
|
linkedEntity: entityName,
|
|
12316
12370
|
category: "interaction",
|
|
12317
|
-
listens: [{ event: "CONFIRM_REMOVE", triggers: "CONFIRM_REMOVE" }],
|
|
12318
12371
|
stateMachine: {
|
|
12319
12372
|
states: [
|
|
12320
12373
|
{ name: "browsing", isInitial: true },
|
|
@@ -12323,9 +12376,7 @@ function buildCartTrait(c) {
|
|
|
12323
12376
|
events: [
|
|
12324
12377
|
{ key: "INIT", name: "Initialize" },
|
|
12325
12378
|
{ key: "ADD_ITEM", name: "Add Item" },
|
|
12326
|
-
{ key: "SAVE", name: "Save", payload: [{ name: "data", type: "object", required: true }] },
|
|
12327
12379
|
{ key: "REQUEST_REMOVE", name: "Request Remove", payload: [{ name: "id", type: "string", required: true }] },
|
|
12328
|
-
{ key: "CONFIRM_REMOVE", name: "Confirm Remove", payload: [{ name: "data", type: "object", required: true }] },
|
|
12329
12380
|
{ key: "PROCEED_CHECKOUT", name: "Proceed to Checkout" },
|
|
12330
12381
|
{ key: "BACK_TO_CART", name: "Back to Cart" },
|
|
12331
12382
|
{ key: "CONFIRM_ORDER", name: "Confirm Order" }
|
|
@@ -12333,7 +12384,7 @@ function buildCartTrait(c) {
|
|
|
12333
12384
|
transitions: [
|
|
12334
12385
|
// browsing + INIT (data-grid handles empty vs populated automatically)
|
|
12335
12386
|
{ from: "browsing", to: "browsing", event: "INIT", effects: [
|
|
12336
|
-
["
|
|
12387
|
+
["ref", entityName],
|
|
12337
12388
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
12338
12389
|
headerBar,
|
|
12339
12390
|
{ type: "divider" },
|
|
@@ -12352,13 +12403,9 @@ function buildCartTrait(c) {
|
|
|
12352
12403
|
{ type: "button", label: checkoutButtonLabel, event: "PROCEED_CHECKOUT", variant: "primary", icon: "arrow-right" }
|
|
12353
12404
|
] }]
|
|
12354
12405
|
] },
|
|
12355
|
-
// SAVE: re-fetch after modal adds an item (shared event bus)
|
|
12356
|
-
{ from: "browsing", to: "browsing", event: "SAVE", effects: [["fetch", entityName]] },
|
|
12357
|
-
// CONFIRM_REMOVE: re-fetch after confirmation trait deletes item
|
|
12358
|
-
{ from: "browsing", to: "browsing", event: "CONFIRM_REMOVE", effects: [["fetch", entityName]] },
|
|
12359
12406
|
// PROCEED_CHECKOUT
|
|
12360
12407
|
{ from: "browsing", to: "checkout", event: "PROCEED_CHECKOUT", effects: [
|
|
12361
|
-
["
|
|
12408
|
+
["ref", entityName],
|
|
12362
12409
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
12363
12410
|
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
12364
12411
|
{ type: "icon", name: "clipboard", size: "lg" },
|
|
@@ -12373,10 +12420,10 @@ function buildCartTrait(c) {
|
|
|
12373
12420
|
] }]
|
|
12374
12421
|
] },
|
|
12375
12422
|
// BACK_TO_CART
|
|
12376
|
-
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["
|
|
12423
|
+
{ from: "checkout", to: "browsing", event: "BACK_TO_CART", effects: [["ref", entityName]] },
|
|
12377
12424
|
// CONFIRM_ORDER
|
|
12378
12425
|
{ from: "checkout", to: "browsing", event: "CONFIRM_ORDER", effects: [
|
|
12379
|
-
["
|
|
12426
|
+
["ref", entityName],
|
|
12380
12427
|
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [
|
|
12381
12428
|
{ type: "icon", name: "check-circle", size: "lg" },
|
|
12382
12429
|
{ type: "typography", content: "Order Confirmed", variant: "h2" },
|
|
@@ -12432,7 +12479,7 @@ function stdCart(params) {
|
|
|
12432
12479
|
closeEvent: "CLOSE",
|
|
12433
12480
|
openEffects: [["fetch", entityName]],
|
|
12434
12481
|
saveEvent: "SAVE",
|
|
12435
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
12482
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]]
|
|
12436
12483
|
}));
|
|
12437
12484
|
const removeTrait = extractTrait(stdConfirmation({
|
|
12438
12485
|
standalone: false,
|
|
@@ -12445,8 +12492,7 @@ function stdCart(params) {
|
|
|
12445
12492
|
headerIcon: "trash-2",
|
|
12446
12493
|
requestEvent: "REQUEST_REMOVE",
|
|
12447
12494
|
confirmEvent: "CONFIRM_REMOVE",
|
|
12448
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
12449
|
-
emitOnConfirm: "CONFIRM_REMOVE"
|
|
12495
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]]
|
|
12450
12496
|
}));
|
|
12451
12497
|
const removeSm = removeTrait.stateMachine;
|
|
12452
12498
|
if (removeSm && "events" in removeSm) {
|
|
@@ -12556,7 +12602,7 @@ function stdDetail(params) {
|
|
|
12556
12602
|
closeEvent: "CLOSE",
|
|
12557
12603
|
openEffects: [["fetch", entityName]],
|
|
12558
12604
|
saveEvent: "SAVE",
|
|
12559
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
12605
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
12560
12606
|
emitOnSave: "SAVE"
|
|
12561
12607
|
}));
|
|
12562
12608
|
const viewTrait = extractTrait(stdModal({
|
|
@@ -12723,7 +12769,7 @@ function stdInventory(params) {
|
|
|
12723
12769
|
closeEvent: "CLOSE",
|
|
12724
12770
|
openEffects: [["fetch", entityName]],
|
|
12725
12771
|
saveEvent: "SAVE",
|
|
12726
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
12772
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
12727
12773
|
emitOnSave: "ITEM_ADDED"
|
|
12728
12774
|
}));
|
|
12729
12775
|
const useTrait = extractTrait(stdModal({
|
|
@@ -12739,7 +12785,7 @@ function stdInventory(params) {
|
|
|
12739
12785
|
closeEvent: "CLOSE",
|
|
12740
12786
|
openEffects: [["fetch", entityName, "@payload.id"]],
|
|
12741
12787
|
saveEvent: "SAVE",
|
|
12742
|
-
saveEffects: [["persist", "update", entityName, "@payload.data"]
|
|
12788
|
+
saveEffects: [["persist", "update", entityName, "@payload.data"]],
|
|
12743
12789
|
emitOnSave: "ITEM_USED"
|
|
12744
12790
|
}));
|
|
12745
12791
|
const dropTrait = extractTrait(stdConfirmation({
|
|
@@ -12753,7 +12799,7 @@ function stdInventory(params) {
|
|
|
12753
12799
|
headerIcon: "trash-2",
|
|
12754
12800
|
requestEvent: "DROP",
|
|
12755
12801
|
confirmEvent: "CONFIRM_DROP",
|
|
12756
|
-
confirmEffects: [["persist", "delete", entityName, "@payload.id"]
|
|
12802
|
+
confirmEffects: [["persist", "delete", entityName, "@payload.id"]],
|
|
12757
12803
|
emitOnConfirm: "CONFIRM_DROP"
|
|
12758
12804
|
}));
|
|
12759
12805
|
const dropSm = dropTrait.stateMachine;
|
|
@@ -12909,7 +12955,7 @@ function stdMessaging(params) {
|
|
|
12909
12955
|
openEvent: "COMPOSE",
|
|
12910
12956
|
closeEvent: "CLOSE",
|
|
12911
12957
|
saveEvent: "SEND",
|
|
12912
|
-
saveEffects: [["persist", "create", entityName, "@payload.data"]
|
|
12958
|
+
saveEffects: [["persist", "create", entityName, "@payload.data"]],
|
|
12913
12959
|
emitOnSave: "SEND"
|
|
12914
12960
|
}));
|
|
12915
12961
|
const viewTrait = extractTrait(stdModal({
|