@almadar/core 10.9.0 → 10.11.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 +3 -3
- package/dist/builders.js +15 -5
- package/dist/builders.js.map +1 -1
- package/dist/{compose-behaviors-CNTCOsui.d.ts → compose-behaviors-D9bQEgqN.d.ts} +1 -1
- package/dist/factory/index.d.ts +60 -8
- package/dist/factory/index.js +67 -31
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +176 -0
- package/dist/factory-runtime/index.js +1727 -0
- package/dist/factory-runtime/index.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +68 -32
- package/dist/index.js.map +1 -1
- package/dist/{schema-DAc5czBW.d.ts → schema-CtOoanon.d.ts} +1 -1
- package/dist/{trait-CWjT0yBO.d.ts → trait-BB1dc5A_.d.ts} +12 -2
- package/dist/types/index.d.ts +318 -7
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/{types-CQvAbsEc.d.ts → types-COc0mLs1.d.ts} +5 -1
- package/package.json +6 -1
package/dist/builders.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TraitConfig, U as UISlot, E as Effect, a as Trait, R as RenderBinding, b as RenderUIEffect, c as TraitEventContract, d as Entity, e as TraitEventListener, C as CallSiteConfig, f as EntityField, g as EntityPersistence, h as EntityRow, i as TraitRef, j as TraitReference } from './trait-
|
|
2
|
-
import { O as OrbitalSchema, U as UseDeclaration, E as EntityRef, P as PageRef, a as OrbitalDefinition, b as Page, c as PageRefObject } from './schema-
|
|
1
|
+
import { T as TraitConfig, U as UISlot, E as Effect, a as Trait, R as RenderBinding, b as RenderUIEffect, c as TraitEventContract, d as Entity, e as TraitEventListener, C as CallSiteConfig, f as EntityField, g as EntityPersistence, h as EntityRow, i as TraitRef, j as TraitReference } from './trait-BB1dc5A_.js';
|
|
2
|
+
import { O as OrbitalSchema, U as UseDeclaration, E as EntityRef, P as PageRef, a as OrbitalDefinition, b as Page, c as PageRefObject } from './schema-CtOoanon.js';
|
|
3
3
|
import { S as SExpr } from './expression-BUIi9ezJ.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-D9bQEgqN.js';
|
|
5
5
|
import { AnyPatternConfig } from '@almadar/patterns';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
package/dist/builders.js
CHANGED
|
@@ -344,6 +344,9 @@ var TraitConfigValueSchema = z.lazy(
|
|
|
344
344
|
])
|
|
345
345
|
);
|
|
346
346
|
var TraitConfigSchema = z.record(TraitConfigValueSchema);
|
|
347
|
+
function isCallSiteConfigDeclaration(entry) {
|
|
348
|
+
return typeof entry === "object" && entry !== null && !Array.isArray(entry) && "type" in entry && typeof entry.type === "string" && "default" in entry;
|
|
349
|
+
}
|
|
347
350
|
var ConfigFieldDeclarationSchema = z.object({
|
|
348
351
|
type: z.string(),
|
|
349
352
|
default: TraitConfigValueSchema.optional(),
|
|
@@ -1192,18 +1195,25 @@ function overrideTrait(trait, values) {
|
|
|
1192
1195
|
if ("scope" in trait) {
|
|
1193
1196
|
const config = trait.config;
|
|
1194
1197
|
if (config === void 0) return trait;
|
|
1195
|
-
const
|
|
1198
|
+
const next2 = { ...config };
|
|
1196
1199
|
for (const [field, value] of Object.entries(values)) {
|
|
1197
1200
|
const decl = config[field];
|
|
1198
1201
|
if (decl !== void 0) {
|
|
1199
|
-
|
|
1202
|
+
next2[field] = { ...decl, default: value };
|
|
1200
1203
|
}
|
|
1201
1204
|
}
|
|
1202
|
-
return { ...trait, config:
|
|
1205
|
+
return { ...trait, config: next2 };
|
|
1203
1206
|
}
|
|
1204
1207
|
const base = trait.config !== void 0 ? { ...trait.config } : {};
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1208
|
+
const next = {};
|
|
1209
|
+
for (const [field, entry] of Object.entries(base)) {
|
|
1210
|
+
next[field] = isCallSiteConfigDeclaration(entry) ? entry : { type: "unknown", default: entry };
|
|
1211
|
+
}
|
|
1212
|
+
for (const [field, value] of Object.entries(values)) {
|
|
1213
|
+
const existing = base[field];
|
|
1214
|
+
next[field] = existing !== void 0 && isCallSiteConfigDeclaration(existing) ? { ...existing, default: value } : { type: "unknown", default: value };
|
|
1215
|
+
}
|
|
1216
|
+
return { ...trait, config: next };
|
|
1207
1217
|
}
|
|
1208
1218
|
function traitIdentity(trait) {
|
|
1209
1219
|
if (trait.name !== void 0) return trait.name;
|