@almadar/ui 4.5.2 → 4.6.1
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/dist/avl/index.cjs +38 -5
- package/dist/avl/index.js +38 -5
- package/dist/components/index.cjs +2 -1
- package/dist/components/index.js +2 -1
- package/dist/providers/index.cjs +2 -1
- package/dist/providers/index.js +2 -1
- package/dist/runtime/index.cjs +38 -5
- package/dist/runtime/index.js +38 -5
- package/package.json +2 -2
package/dist/avl/index.cjs
CHANGED
|
@@ -15725,7 +15725,7 @@ function extractEntityFields(schema) {
|
|
|
15725
15725
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
15726
15726
|
const inlineEntity = entity;
|
|
15727
15727
|
if (!inlineEntity.fields) return [];
|
|
15728
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
15728
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
15729
15729
|
}
|
|
15730
15730
|
function toStateMachineDefinition(sm) {
|
|
15731
15731
|
return {
|
|
@@ -32275,6 +32275,7 @@ var init_Form = __esm({
|
|
|
32275
32275
|
"form",
|
|
32276
32276
|
{
|
|
32277
32277
|
noValidate: true,
|
|
32278
|
+
"data-pattern": "form-section",
|
|
32278
32279
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
32279
32280
|
onSubmit: handleSubmit,
|
|
32280
32281
|
...props,
|
|
@@ -51476,6 +51477,7 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51476
51477
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
51477
51478
|
const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
|
|
51478
51479
|
const results = currentManager.sendEvent(normalizedEvent, payload);
|
|
51480
|
+
const emittedByTrait = /* @__PURE__ */ new Map();
|
|
51479
51481
|
for (const { traitName, result } of results) {
|
|
51480
51482
|
const binding = bindingMap.get(traitName);
|
|
51481
51483
|
const traitState = currentManager.getState(traitName);
|
|
@@ -51594,7 +51596,17 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51594
51596
|
linkedEntity,
|
|
51595
51597
|
entityId
|
|
51596
51598
|
};
|
|
51597
|
-
const
|
|
51599
|
+
const emittedDuringExec = [];
|
|
51600
|
+
emittedByTrait.set(traitName, emittedDuringExec);
|
|
51601
|
+
const baseEmit = handlers.emit;
|
|
51602
|
+
const trackingHandlers = {
|
|
51603
|
+
...handlers,
|
|
51604
|
+
emit: (event, eventPayload, source) => {
|
|
51605
|
+
emittedDuringExec.push(event);
|
|
51606
|
+
baseEmit(event, eventPayload, source);
|
|
51607
|
+
}
|
|
51608
|
+
};
|
|
51609
|
+
const executor = new runtime.EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
51598
51610
|
try {
|
|
51599
51611
|
await executor.executeAll(result.effects);
|
|
51600
51612
|
console.log(
|
|
@@ -51666,13 +51678,33 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51666
51678
|
};
|
|
51667
51679
|
}
|
|
51668
51680
|
);
|
|
51681
|
+
const emittedEvents = emittedByTrait.get(traitName) ?? [];
|
|
51669
51682
|
recordTransition({
|
|
51670
51683
|
traitName,
|
|
51671
51684
|
from: result.previousState,
|
|
51672
51685
|
to: result.newState,
|
|
51673
51686
|
event: normalizedEvent,
|
|
51674
51687
|
effects: effectTraces,
|
|
51675
|
-
timestamp: Date.now()
|
|
51688
|
+
timestamp: Date.now(),
|
|
51689
|
+
// Populate ServerResponseTrace.emittedEvents whenever this
|
|
51690
|
+
// trait's effects fired anything via handlers.emit (e.g.
|
|
51691
|
+
// a persist's declared emit.success → ITEM_CREATED).
|
|
51692
|
+
// Without this, the verifier's data-mutation observer's
|
|
51693
|
+
// `frame.serverResponse?.emittedEvents` arrives null and
|
|
51694
|
+
// the cascade-was-empty fail surfaces despite the runtime
|
|
51695
|
+
// having dispatched the event correctly.
|
|
51696
|
+
...emittedEvents.length > 0 && {
|
|
51697
|
+
serverResponse: {
|
|
51698
|
+
// orbitalName is metadata for the debug timeline;
|
|
51699
|
+
// the verifier reads emittedEvents only.
|
|
51700
|
+
orbitalName: "",
|
|
51701
|
+
success: true,
|
|
51702
|
+
clientEffects: effectTraces.length,
|
|
51703
|
+
dataEntities: {},
|
|
51704
|
+
emittedEvents,
|
|
51705
|
+
timestamp: Date.now()
|
|
51706
|
+
}
|
|
51707
|
+
}
|
|
51676
51708
|
});
|
|
51677
51709
|
}
|
|
51678
51710
|
}
|
|
@@ -51964,7 +51996,7 @@ init_verificationRegistry();
|
|
|
51964
51996
|
function generateEntityRow(entity, idx) {
|
|
51965
51997
|
const row = { id: String(idx) };
|
|
51966
51998
|
for (const f3 of entity.fields) {
|
|
51967
|
-
if (f3.name === "id") continue;
|
|
51999
|
+
if (f3.name === void 0 || f3.name === "id") continue;
|
|
51968
52000
|
row[f3.name] = generateFieldValue(entity.name, f3, idx);
|
|
51969
52001
|
}
|
|
51970
52002
|
return row;
|
|
@@ -51973,9 +52005,10 @@ function generateFieldValue(entityName, field, idx) {
|
|
|
51973
52005
|
if (field.values && field.values.length > 0) {
|
|
51974
52006
|
return field.values[(idx - 1) % field.values.length];
|
|
51975
52007
|
}
|
|
52008
|
+
const fieldName = field.name ?? "";
|
|
51976
52009
|
switch (field.type) {
|
|
51977
52010
|
case "string":
|
|
51978
|
-
return `${entityName} ${
|
|
52011
|
+
return `${entityName} ${fieldName.charAt(0).toUpperCase() + fieldName.slice(1)} ${idx}`;
|
|
51979
52012
|
case "number":
|
|
51980
52013
|
return idx * 10;
|
|
51981
52014
|
case "boolean":
|
package/dist/avl/index.js
CHANGED
|
@@ -15679,7 +15679,7 @@ function extractEntityFields(schema) {
|
|
|
15679
15679
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
15680
15680
|
const inlineEntity = entity;
|
|
15681
15681
|
if (!inlineEntity.fields) return [];
|
|
15682
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
15682
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
15683
15683
|
}
|
|
15684
15684
|
function toStateMachineDefinition(sm) {
|
|
15685
15685
|
return {
|
|
@@ -32229,6 +32229,7 @@ var init_Form = __esm({
|
|
|
32229
32229
|
"form",
|
|
32230
32230
|
{
|
|
32231
32231
|
noValidate: true,
|
|
32232
|
+
"data-pattern": "form-section",
|
|
32232
32233
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
32233
32234
|
onSubmit: handleSubmit,
|
|
32234
32235
|
...props,
|
|
@@ -51430,6 +51431,7 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51430
51431
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
51431
51432
|
const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
|
|
51432
51433
|
const results = currentManager.sendEvent(normalizedEvent, payload);
|
|
51434
|
+
const emittedByTrait = /* @__PURE__ */ new Map();
|
|
51433
51435
|
for (const { traitName, result } of results) {
|
|
51434
51436
|
const binding = bindingMap.get(traitName);
|
|
51435
51437
|
const traitState = currentManager.getState(traitName);
|
|
@@ -51548,7 +51550,17 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51548
51550
|
linkedEntity,
|
|
51549
51551
|
entityId
|
|
51550
51552
|
};
|
|
51551
|
-
const
|
|
51553
|
+
const emittedDuringExec = [];
|
|
51554
|
+
emittedByTrait.set(traitName, emittedDuringExec);
|
|
51555
|
+
const baseEmit = handlers.emit;
|
|
51556
|
+
const trackingHandlers = {
|
|
51557
|
+
...handlers,
|
|
51558
|
+
emit: (event, eventPayload, source) => {
|
|
51559
|
+
emittedDuringExec.push(event);
|
|
51560
|
+
baseEmit(event, eventPayload, source);
|
|
51561
|
+
}
|
|
51562
|
+
};
|
|
51563
|
+
const executor = new EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
51552
51564
|
try {
|
|
51553
51565
|
await executor.executeAll(result.effects);
|
|
51554
51566
|
console.log(
|
|
@@ -51620,13 +51632,33 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51620
51632
|
};
|
|
51621
51633
|
}
|
|
51622
51634
|
);
|
|
51635
|
+
const emittedEvents = emittedByTrait.get(traitName) ?? [];
|
|
51623
51636
|
recordTransition({
|
|
51624
51637
|
traitName,
|
|
51625
51638
|
from: result.previousState,
|
|
51626
51639
|
to: result.newState,
|
|
51627
51640
|
event: normalizedEvent,
|
|
51628
51641
|
effects: effectTraces,
|
|
51629
|
-
timestamp: Date.now()
|
|
51642
|
+
timestamp: Date.now(),
|
|
51643
|
+
// Populate ServerResponseTrace.emittedEvents whenever this
|
|
51644
|
+
// trait's effects fired anything via handlers.emit (e.g.
|
|
51645
|
+
// a persist's declared emit.success → ITEM_CREATED).
|
|
51646
|
+
// Without this, the verifier's data-mutation observer's
|
|
51647
|
+
// `frame.serverResponse?.emittedEvents` arrives null and
|
|
51648
|
+
// the cascade-was-empty fail surfaces despite the runtime
|
|
51649
|
+
// having dispatched the event correctly.
|
|
51650
|
+
...emittedEvents.length > 0 && {
|
|
51651
|
+
serverResponse: {
|
|
51652
|
+
// orbitalName is metadata for the debug timeline;
|
|
51653
|
+
// the verifier reads emittedEvents only.
|
|
51654
|
+
orbitalName: "",
|
|
51655
|
+
success: true,
|
|
51656
|
+
clientEffects: effectTraces.length,
|
|
51657
|
+
dataEntities: {},
|
|
51658
|
+
emittedEvents,
|
|
51659
|
+
timestamp: Date.now()
|
|
51660
|
+
}
|
|
51661
|
+
}
|
|
51630
51662
|
});
|
|
51631
51663
|
}
|
|
51632
51664
|
}
|
|
@@ -51918,7 +51950,7 @@ init_verificationRegistry();
|
|
|
51918
51950
|
function generateEntityRow(entity, idx) {
|
|
51919
51951
|
const row = { id: String(idx) };
|
|
51920
51952
|
for (const f3 of entity.fields) {
|
|
51921
|
-
if (f3.name === "id") continue;
|
|
51953
|
+
if (f3.name === void 0 || f3.name === "id") continue;
|
|
51922
51954
|
row[f3.name] = generateFieldValue(entity.name, f3, idx);
|
|
51923
51955
|
}
|
|
51924
51956
|
return row;
|
|
@@ -51927,9 +51959,10 @@ function generateFieldValue(entityName, field, idx) {
|
|
|
51927
51959
|
if (field.values && field.values.length > 0) {
|
|
51928
51960
|
return field.values[(idx - 1) % field.values.length];
|
|
51929
51961
|
}
|
|
51962
|
+
const fieldName = field.name ?? "";
|
|
51930
51963
|
switch (field.type) {
|
|
51931
51964
|
case "string":
|
|
51932
|
-
return `${entityName} ${
|
|
51965
|
+
return `${entityName} ${fieldName.charAt(0).toUpperCase() + fieldName.slice(1)} ${idx}`;
|
|
51933
51966
|
case "number":
|
|
51934
51967
|
return idx * 10;
|
|
51935
51968
|
case "boolean":
|
|
@@ -11022,7 +11022,7 @@ function extractEntityFields(schema) {
|
|
|
11022
11022
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
11023
11023
|
const inlineEntity = entity;
|
|
11024
11024
|
if (!inlineEntity.fields) return [];
|
|
11025
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
11025
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
11026
11026
|
}
|
|
11027
11027
|
function toStateMachineDefinition(sm) {
|
|
11028
11028
|
return {
|
|
@@ -28168,6 +28168,7 @@ var init_Form = __esm({
|
|
|
28168
28168
|
"form",
|
|
28169
28169
|
{
|
|
28170
28170
|
noValidate: true,
|
|
28171
|
+
"data-pattern": "form-section",
|
|
28171
28172
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
28172
28173
|
onSubmit: handleSubmit,
|
|
28173
28174
|
...props,
|
package/dist/components/index.js
CHANGED
|
@@ -10977,7 +10977,7 @@ function extractEntityFields(schema) {
|
|
|
10977
10977
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
10978
10978
|
const inlineEntity = entity;
|
|
10979
10979
|
if (!inlineEntity.fields) return [];
|
|
10980
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
10980
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
10981
10981
|
}
|
|
10982
10982
|
function toStateMachineDefinition(sm) {
|
|
10983
10983
|
return {
|
|
@@ -28123,6 +28123,7 @@ var init_Form = __esm({
|
|
|
28123
28123
|
"form",
|
|
28124
28124
|
{
|
|
28125
28125
|
noValidate: true,
|
|
28126
|
+
"data-pattern": "form-section",
|
|
28126
28127
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
28127
28128
|
onSubmit: handleSubmit,
|
|
28128
28129
|
...props,
|
package/dist/providers/index.cjs
CHANGED
|
@@ -12565,7 +12565,7 @@ function extractEntityFields(schema) {
|
|
|
12565
12565
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12566
12566
|
const inlineEntity = entity;
|
|
12567
12567
|
if (!inlineEntity.fields) return [];
|
|
12568
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
12568
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
12569
12569
|
}
|
|
12570
12570
|
function toStateMachineDefinition(sm) {
|
|
12571
12571
|
return {
|
|
@@ -29115,6 +29115,7 @@ var init_Form = __esm({
|
|
|
29115
29115
|
"form",
|
|
29116
29116
|
{
|
|
29117
29117
|
noValidate: true,
|
|
29118
|
+
"data-pattern": "form-section",
|
|
29118
29119
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
29119
29120
|
onSubmit: handleSubmit,
|
|
29120
29121
|
...props,
|
package/dist/providers/index.js
CHANGED
|
@@ -12520,7 +12520,7 @@ function extractEntityFields(schema) {
|
|
|
12520
12520
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12521
12521
|
const inlineEntity = entity;
|
|
12522
12522
|
if (!inlineEntity.fields) return [];
|
|
12523
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
12523
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
12524
12524
|
}
|
|
12525
12525
|
function toStateMachineDefinition(sm) {
|
|
12526
12526
|
return {
|
|
@@ -29070,6 +29070,7 @@ var init_Form = __esm({
|
|
|
29070
29070
|
"form",
|
|
29071
29071
|
{
|
|
29072
29072
|
noValidate: true,
|
|
29073
|
+
"data-pattern": "form-section",
|
|
29073
29074
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
29074
29075
|
onSubmit: handleSubmit,
|
|
29075
29076
|
...props,
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -12450,7 +12450,7 @@ function extractEntityFields(schema) {
|
|
|
12450
12450
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12451
12451
|
const inlineEntity = entity;
|
|
12452
12452
|
if (!inlineEntity.fields) return [];
|
|
12453
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
12453
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
12454
12454
|
}
|
|
12455
12455
|
function toStateMachineDefinition(sm) {
|
|
12456
12456
|
return {
|
|
@@ -28717,6 +28717,7 @@ var init_Form = __esm({
|
|
|
28717
28717
|
"form",
|
|
28718
28718
|
{
|
|
28719
28719
|
noValidate: true,
|
|
28720
|
+
"data-pattern": "form-section",
|
|
28720
28721
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
28721
28722
|
onSubmit: handleSubmit,
|
|
28722
28723
|
...props,
|
|
@@ -38194,6 +38195,7 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38194
38195
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
38195
38196
|
const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
|
|
38196
38197
|
const results = currentManager.sendEvent(normalizedEvent, payload);
|
|
38198
|
+
const emittedByTrait = /* @__PURE__ */ new Map();
|
|
38197
38199
|
for (const { traitName, result } of results) {
|
|
38198
38200
|
const binding = bindingMap.get(traitName);
|
|
38199
38201
|
const traitState = currentManager.getState(traitName);
|
|
@@ -38312,7 +38314,17 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38312
38314
|
linkedEntity,
|
|
38313
38315
|
entityId
|
|
38314
38316
|
};
|
|
38315
|
-
const
|
|
38317
|
+
const emittedDuringExec = [];
|
|
38318
|
+
emittedByTrait.set(traitName, emittedDuringExec);
|
|
38319
|
+
const baseEmit = handlers.emit;
|
|
38320
|
+
const trackingHandlers = {
|
|
38321
|
+
...handlers,
|
|
38322
|
+
emit: (event, eventPayload, source) => {
|
|
38323
|
+
emittedDuringExec.push(event);
|
|
38324
|
+
baseEmit(event, eventPayload, source);
|
|
38325
|
+
}
|
|
38326
|
+
};
|
|
38327
|
+
const executor = new runtime.EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
38316
38328
|
try {
|
|
38317
38329
|
await executor.executeAll(result.effects);
|
|
38318
38330
|
console.log(
|
|
@@ -38384,13 +38396,33 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38384
38396
|
};
|
|
38385
38397
|
}
|
|
38386
38398
|
);
|
|
38399
|
+
const emittedEvents = emittedByTrait.get(traitName) ?? [];
|
|
38387
38400
|
recordTransition({
|
|
38388
38401
|
traitName,
|
|
38389
38402
|
from: result.previousState,
|
|
38390
38403
|
to: result.newState,
|
|
38391
38404
|
event: normalizedEvent,
|
|
38392
38405
|
effects: effectTraces,
|
|
38393
|
-
timestamp: Date.now()
|
|
38406
|
+
timestamp: Date.now(),
|
|
38407
|
+
// Populate ServerResponseTrace.emittedEvents whenever this
|
|
38408
|
+
// trait's effects fired anything via handlers.emit (e.g.
|
|
38409
|
+
// a persist's declared emit.success → ITEM_CREATED).
|
|
38410
|
+
// Without this, the verifier's data-mutation observer's
|
|
38411
|
+
// `frame.serverResponse?.emittedEvents` arrives null and
|
|
38412
|
+
// the cascade-was-empty fail surfaces despite the runtime
|
|
38413
|
+
// having dispatched the event correctly.
|
|
38414
|
+
...emittedEvents.length > 0 && {
|
|
38415
|
+
serverResponse: {
|
|
38416
|
+
// orbitalName is metadata for the debug timeline;
|
|
38417
|
+
// the verifier reads emittedEvents only.
|
|
38418
|
+
orbitalName: "",
|
|
38419
|
+
success: true,
|
|
38420
|
+
clientEffects: effectTraces.length,
|
|
38421
|
+
dataEntities: {},
|
|
38422
|
+
emittedEvents,
|
|
38423
|
+
timestamp: Date.now()
|
|
38424
|
+
}
|
|
38425
|
+
}
|
|
38394
38426
|
});
|
|
38395
38427
|
}
|
|
38396
38428
|
}
|
|
@@ -38804,7 +38836,7 @@ init_verificationRegistry();
|
|
|
38804
38836
|
function generateEntityRow(entity, idx) {
|
|
38805
38837
|
const row = { id: String(idx) };
|
|
38806
38838
|
for (const f3 of entity.fields) {
|
|
38807
|
-
if (f3.name === "id") continue;
|
|
38839
|
+
if (f3.name === void 0 || f3.name === "id") continue;
|
|
38808
38840
|
row[f3.name] = generateFieldValue(entity.name, f3, idx);
|
|
38809
38841
|
}
|
|
38810
38842
|
return row;
|
|
@@ -38813,9 +38845,10 @@ function generateFieldValue(entityName, field, idx) {
|
|
|
38813
38845
|
if (field.values && field.values.length > 0) {
|
|
38814
38846
|
return field.values[(idx - 1) % field.values.length];
|
|
38815
38847
|
}
|
|
38848
|
+
const fieldName = field.name ?? "";
|
|
38816
38849
|
switch (field.type) {
|
|
38817
38850
|
case "string":
|
|
38818
|
-
return `${entityName} ${
|
|
38851
|
+
return `${entityName} ${fieldName.charAt(0).toUpperCase() + fieldName.slice(1)} ${idx}`;
|
|
38819
38852
|
case "number":
|
|
38820
38853
|
return idx * 10;
|
|
38821
38854
|
case "boolean":
|
package/dist/runtime/index.js
CHANGED
|
@@ -12405,7 +12405,7 @@ function extractEntityFields(schema) {
|
|
|
12405
12405
|
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12406
12406
|
const inlineEntity = entity;
|
|
12407
12407
|
if (!inlineEntity.fields) return [];
|
|
12408
|
-
return inlineEntity.fields.map((f3) => f3.name);
|
|
12408
|
+
return inlineEntity.fields.map((f3) => f3.name).filter((n) => typeof n === "string" && n.length > 0);
|
|
12409
12409
|
}
|
|
12410
12410
|
function toStateMachineDefinition(sm) {
|
|
12411
12411
|
return {
|
|
@@ -28672,6 +28672,7 @@ var init_Form = __esm({
|
|
|
28672
28672
|
"form",
|
|
28673
28673
|
{
|
|
28674
28674
|
noValidate: true,
|
|
28675
|
+
"data-pattern": "form-section",
|
|
28675
28676
|
className: cn(layoutStyles[layout], gapStyles8[gap], className),
|
|
28676
28677
|
onSubmit: handleSubmit,
|
|
28677
28678
|
...props,
|
|
@@ -38149,6 +38150,7 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38149
38150
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
38150
38151
|
const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
|
|
38151
38152
|
const results = currentManager.sendEvent(normalizedEvent, payload);
|
|
38153
|
+
const emittedByTrait = /* @__PURE__ */ new Map();
|
|
38152
38154
|
for (const { traitName, result } of results) {
|
|
38153
38155
|
const binding = bindingMap.get(traitName);
|
|
38154
38156
|
const traitState = currentManager.getState(traitName);
|
|
@@ -38267,7 +38269,17 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38267
38269
|
linkedEntity,
|
|
38268
38270
|
entityId
|
|
38269
38271
|
};
|
|
38270
|
-
const
|
|
38272
|
+
const emittedDuringExec = [];
|
|
38273
|
+
emittedByTrait.set(traitName, emittedDuringExec);
|
|
38274
|
+
const baseEmit = handlers.emit;
|
|
38275
|
+
const trackingHandlers = {
|
|
38276
|
+
...handlers,
|
|
38277
|
+
emit: (event, eventPayload, source) => {
|
|
38278
|
+
emittedDuringExec.push(event);
|
|
38279
|
+
baseEmit(event, eventPayload, source);
|
|
38280
|
+
}
|
|
38281
|
+
};
|
|
38282
|
+
const executor = new EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
38271
38283
|
try {
|
|
38272
38284
|
await executor.executeAll(result.effects);
|
|
38273
38285
|
console.log(
|
|
@@ -38339,13 +38351,33 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38339
38351
|
};
|
|
38340
38352
|
}
|
|
38341
38353
|
);
|
|
38354
|
+
const emittedEvents = emittedByTrait.get(traitName) ?? [];
|
|
38342
38355
|
recordTransition({
|
|
38343
38356
|
traitName,
|
|
38344
38357
|
from: result.previousState,
|
|
38345
38358
|
to: result.newState,
|
|
38346
38359
|
event: normalizedEvent,
|
|
38347
38360
|
effects: effectTraces,
|
|
38348
|
-
timestamp: Date.now()
|
|
38361
|
+
timestamp: Date.now(),
|
|
38362
|
+
// Populate ServerResponseTrace.emittedEvents whenever this
|
|
38363
|
+
// trait's effects fired anything via handlers.emit (e.g.
|
|
38364
|
+
// a persist's declared emit.success → ITEM_CREATED).
|
|
38365
|
+
// Without this, the verifier's data-mutation observer's
|
|
38366
|
+
// `frame.serverResponse?.emittedEvents` arrives null and
|
|
38367
|
+
// the cascade-was-empty fail surfaces despite the runtime
|
|
38368
|
+
// having dispatched the event correctly.
|
|
38369
|
+
...emittedEvents.length > 0 && {
|
|
38370
|
+
serverResponse: {
|
|
38371
|
+
// orbitalName is metadata for the debug timeline;
|
|
38372
|
+
// the verifier reads emittedEvents only.
|
|
38373
|
+
orbitalName: "",
|
|
38374
|
+
success: true,
|
|
38375
|
+
clientEffects: effectTraces.length,
|
|
38376
|
+
dataEntities: {},
|
|
38377
|
+
emittedEvents,
|
|
38378
|
+
timestamp: Date.now()
|
|
38379
|
+
}
|
|
38380
|
+
}
|
|
38349
38381
|
});
|
|
38350
38382
|
}
|
|
38351
38383
|
}
|
|
@@ -38759,7 +38791,7 @@ init_verificationRegistry();
|
|
|
38759
38791
|
function generateEntityRow(entity, idx) {
|
|
38760
38792
|
const row = { id: String(idx) };
|
|
38761
38793
|
for (const f3 of entity.fields) {
|
|
38762
|
-
if (f3.name === "id") continue;
|
|
38794
|
+
if (f3.name === void 0 || f3.name === "id") continue;
|
|
38763
38795
|
row[f3.name] = generateFieldValue(entity.name, f3, idx);
|
|
38764
38796
|
}
|
|
38765
38797
|
return row;
|
|
@@ -38768,9 +38800,10 @@ function generateFieldValue(entityName, field, idx) {
|
|
|
38768
38800
|
if (field.values && field.values.length > 0) {
|
|
38769
38801
|
return field.values[(idx - 1) % field.values.length];
|
|
38770
38802
|
}
|
|
38803
|
+
const fieldName = field.name ?? "";
|
|
38771
38804
|
switch (field.type) {
|
|
38772
38805
|
case "string":
|
|
38773
|
-
return `${entityName} ${
|
|
38806
|
+
return `${entityName} ${fieldName.charAt(0).toUpperCase() + fieldName.slice(1)} ${idx}`;
|
|
38774
38807
|
case "number":
|
|
38775
38808
|
return idx * 10;
|
|
38776
38809
|
case "boolean":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@almadar/core": "
|
|
121
|
+
"@almadar/core": "^7.0.0",
|
|
122
122
|
"@almadar/evaluator": ">=2.9.2",
|
|
123
123
|
"@almadar/patterns": ">=2.17.1",
|
|
124
124
|
"@almadar/runtime": "^4.11.1",
|