@almadar/core 9.2.0 → 9.4.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/dist/builders.d.ts +9 -3
- package/dist/builders.js +7 -1
- package/dist/builders.js.map +1 -1
- package/dist/{compose-behaviors-DuVOFCpp.d.ts → compose-behaviors-BgQF4nDE.d.ts} +1 -1
- package/dist/factory/index.d.ts +4 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/{schema-zAvm81vl.d.ts → schema-ChiLwvNY.d.ts} +1 -1
- package/dist/{trait-Bs8Bo9_z.d.ts → trait-S6adsRKG.d.ts} +15 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +6 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/builders.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-S6adsRKG.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-ChiLwvNY.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-
|
|
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-BgQF4nDE.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
|
@@ -66,7 +66,8 @@ var EntityFieldSchema = z.lazy(() => {
|
|
|
66
66
|
format: FieldFormatSchema.optional(),
|
|
67
67
|
min: z.number().optional(),
|
|
68
68
|
max: z.number().optional(),
|
|
69
|
-
properties: z.record(EntityFieldSchema).optional()
|
|
69
|
+
properties: z.record(EntityFieldSchema).optional(),
|
|
70
|
+
intrinsic: z.boolean().optional()
|
|
70
71
|
};
|
|
71
72
|
function scalarVariant(t) {
|
|
72
73
|
return z.object({
|
|
@@ -439,6 +440,10 @@ z.object({
|
|
|
439
440
|
z.string().min(1, "events key (atom event name) must be non-empty"),
|
|
440
441
|
z.string().min(1, "events value (caller event name) must be non-empty")
|
|
441
442
|
).optional(),
|
|
443
|
+
fields: z.record(
|
|
444
|
+
z.string().min(1, "fields key (canonical field name) must be non-empty"),
|
|
445
|
+
z.string().min(1, "fields value (consumer field name) must be non-empty")
|
|
446
|
+
).optional(),
|
|
442
447
|
config: TraitConfigSchema.optional(),
|
|
443
448
|
appliesTo: z.array(z.string()).optional(),
|
|
444
449
|
// Phase F.7: zod accepts an array (the inliner validates element
|
|
@@ -1467,6 +1472,7 @@ function makeTraitRef(opts) {
|
|
|
1467
1472
|
if (opts.name !== void 0) ref.name = opts.name;
|
|
1468
1473
|
if (opts.linkedEntity !== void 0) ref.linkedEntity = opts.linkedEntity;
|
|
1469
1474
|
if (opts.events !== void 0) ref.events = opts.events;
|
|
1475
|
+
if (opts.fields !== void 0) ref.fields = opts.fields;
|
|
1470
1476
|
if (opts.effects !== void 0) ref.effects = opts.effects;
|
|
1471
1477
|
if (opts.listens !== void 0) ref.listens = opts.listens;
|
|
1472
1478
|
if (opts.emitsScope !== void 0) ref.emitsScope = opts.emitsScope;
|