@almadar/core 9.2.0 → 9.3.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.
@@ -1,7 +1,7 @@
1
- import { bR as UISlot, u as Effect, bm as Trait, aH as RenderUIEffect, by as TraitEventContract, z as Entity, bA as TraitEventListener, bp as TraitConfig, F as EntityField, K as EntityPersistence, O as EntityRow, bD as TraitRef, bF as TraitReference } from './trait-Bs8Bo9_z.js';
2
- import { bC as UseDeclaration, Q as EntityRef, aT as PageRef, aD as OrbitalDefinition, aL as OrbitalSchema, aS as Page, aU as PageRefObject } from './schema-zAvm81vl.js';
1
+ import { bR as UISlot, u as Effect, bm as Trait, aH as RenderUIEffect, by as TraitEventContract, z as Entity, bA as TraitEventListener, bp as TraitConfig, F as EntityField, K as EntityPersistence, O as EntityRow, bD as TraitRef, bF as TraitReference } from './trait-DmoY7UHh.js';
2
+ import { bC as UseDeclaration, Q as EntityRef, aT as PageRef, aD as OrbitalDefinition, aL as OrbitalSchema, aS as Page, aU as PageRefObject } from './schema-BdATnYqq.js';
3
3
  import { S as SExpr } from './expression-BVRFm0sV.js';
4
- export { C as ComposeBehaviorsInput, a as ComposeBehaviorsResult, E as EventWiringEntry, L as LayoutStrategy, b as applyEventWiring, c as composeBehaviors, d as detectLayoutStrategy } from './compose-behaviors-DuVOFCpp.js';
4
+ export { C as ComposeBehaviorsInput, a as ComposeBehaviorsResult, E as EventWiringEntry, L as LayoutStrategy, b as applyEventWiring, c as composeBehaviors, d as detectLayoutStrategy } from './compose-behaviors-BuJL_Mv8.js';
5
5
  import { AnyPatternConfig } from '@almadar/patterns';
6
6
  import 'zod';
7
7
 
@@ -204,6 +204,12 @@ interface MakeTraitRefOpts {
204
204
  linkedEntity?: string;
205
205
  /** Per-key rename map, e.g. `{ OPEN: "ADD_ITEM" }`. */
206
206
  events?: Record<string, string>;
207
+ /**
208
+ * Entity-field remap, e.g. `{ name: "title", folder: "parentId" }`. Rewrites
209
+ * the inlined trait's canonical `@entity.X` / `@payload.row.X` references to
210
+ * the consumer entity's field names. Mirrors {@link TraitReference.fields}.
211
+ */
212
+ fields?: Record<string, string>;
207
213
  /**
208
214
  * Per-event SExpression effect replacement. Keys are POST-rename event
209
215
  * names. See {@link TraitReference.effects} for the full contract.
package/dist/builders.js CHANGED
@@ -439,6 +439,10 @@ z.object({
439
439
  z.string().min(1, "events key (atom event name) must be non-empty"),
440
440
  z.string().min(1, "events value (caller event name) must be non-empty")
441
441
  ).optional(),
442
+ fields: z.record(
443
+ z.string().min(1, "fields key (canonical field name) must be non-empty"),
444
+ z.string().min(1, "fields value (consumer field name) must be non-empty")
445
+ ).optional(),
442
446
  config: TraitConfigSchema.optional(),
443
447
  appliesTo: z.array(z.string()).optional(),
444
448
  // Phase F.7: zod accepts an array (the inliner validates element
@@ -1467,6 +1471,7 @@ function makeTraitRef(opts) {
1467
1471
  if (opts.name !== void 0) ref.name = opts.name;
1468
1472
  if (opts.linkedEntity !== void 0) ref.linkedEntity = opts.linkedEntity;
1469
1473
  if (opts.events !== void 0) ref.events = opts.events;
1474
+ if (opts.fields !== void 0) ref.fields = opts.fields;
1470
1475
  if (opts.effects !== void 0) ref.effects = opts.effects;
1471
1476
  if (opts.listens !== void 0) ref.listens = opts.listens;
1472
1477
  if (opts.emitsScope !== void 0) ref.emitsScope = opts.emitsScope;