@almadar/ui 4.54.1 → 4.54.3

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.
@@ -59474,15 +59474,24 @@ function buildMockData(schema) {
59474
59474
  const sourceEntity = trait.sourceEntityDefinition;
59475
59475
  if (!sourceEntity || core.isEntityCall(sourceEntity)) continue;
59476
59476
  const sourceName = sourceEntity.name;
59477
- if (!sourceName || result[sourceName]) continue;
59478
- if (sourceEntity.instances && sourceEntity.instances.length > 0) {
59479
- result[sourceName] = sourceEntity.instances;
59480
- continue;
59477
+ if (!sourceName) continue;
59478
+ if (!result[sourceName]) {
59479
+ result[sourceName] = sourceEntity.instances && sourceEntity.instances.length > 0 ? sourceEntity.instances : Array.from(
59480
+ { length: 10 },
59481
+ (_, i) => generateEntityRow(sourceEntity, i + 1)
59482
+ );
59481
59483
  }
59482
- result[sourceName] = Array.from(
59483
- { length: 10 },
59484
- (_, i) => generateEntityRow(sourceEntity, i + 1)
59485
- );
59484
+ const reboundName = trait.linkedEntity;
59485
+ if (!reboundName || reboundName === sourceName) continue;
59486
+ const reboundRows = result[reboundName];
59487
+ if (!reboundRows || reboundRows.length === 0) continue;
59488
+ reboundRows.forEach((row, i) => {
59489
+ for (const f3 of sourceEntity.fields) {
59490
+ if (f3.name === void 0 || f3.name === "id") continue;
59491
+ if (row[f3.name] !== void 0) continue;
59492
+ row[f3.name] = generateFieldValue(sourceName, f3, i + 1);
59493
+ }
59494
+ });
59486
59495
  }
59487
59496
  }
59488
59497
  perfEnd("build-mock-data", t, { orbitalCount: schema.orbitals.length, entityCount: Object.keys(result).length });
@@ -60374,13 +60383,24 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60374
60383
  const allTransitions = sm.transitions ?? [];
60375
60384
  const targetTransition = fromState && toState ? allTransitions.find((t) => t.event === transitionEvent && t.from === fromState && t.to === toState) ?? allTransitions.find((t) => t.event === transitionEvent) : allTransitions.find((t) => t.event === transitionEvent);
60376
60385
  if (!targetTransition?.effects) continue;
60377
- const renderUIEffects = [];
60386
+ const previewEffects = [];
60387
+ let hasRenderUI = false;
60378
60388
  for (const eff of targetTransition.effects) {
60379
- if (Array.isArray(eff) && eff[0] === "render-ui") {
60380
- renderUIEffects.push(eff);
60389
+ if (!Array.isArray(eff)) continue;
60390
+ const op = eff[0];
60391
+ if (op === "render-ui") {
60392
+ previewEffects.push(eff);
60393
+ hasRenderUI = true;
60394
+ continue;
60395
+ }
60396
+ if (op === "set") {
60397
+ const target = eff[1];
60398
+ if (typeof target === "string" && target.startsWith("@entity.")) {
60399
+ previewEffects.push(eff);
60400
+ }
60381
60401
  }
60382
60402
  }
60383
- if (renderUIEffects.length === 0) continue;
60403
+ if (!hasRenderUI) continue;
60384
60404
  const linkedEntity = traitObj.linkedEntity ?? entityNameOf(clonedOrbital.entity);
60385
60405
  const emitContract = findEmitContract(traitObj, transitionEvent);
60386
60406
  const mockPayload = generateMockPayload(
@@ -60389,7 +60409,7 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60389
60409
  linkedEntity,
60390
60410
  mockData
60391
60411
  );
60392
- const seededEffects = substitutePayloadBindings(renderUIEffects, mockPayload);
60412
+ const seededEffects = substitutePayloadBindings(previewEffects, mockPayload);
60393
60413
  traitObj.stateMachine = {
60394
60414
  states: [{ name: "preview", isInitial: true }],
60395
60415
  events: [{ key: "INIT", name: "INIT" }],
package/dist/avl/index.js CHANGED
@@ -59428,15 +59428,24 @@ function buildMockData(schema) {
59428
59428
  const sourceEntity = trait.sourceEntityDefinition;
59429
59429
  if (!sourceEntity || isEntityCall(sourceEntity)) continue;
59430
59430
  const sourceName = sourceEntity.name;
59431
- if (!sourceName || result[sourceName]) continue;
59432
- if (sourceEntity.instances && sourceEntity.instances.length > 0) {
59433
- result[sourceName] = sourceEntity.instances;
59434
- continue;
59431
+ if (!sourceName) continue;
59432
+ if (!result[sourceName]) {
59433
+ result[sourceName] = sourceEntity.instances && sourceEntity.instances.length > 0 ? sourceEntity.instances : Array.from(
59434
+ { length: 10 },
59435
+ (_, i) => generateEntityRow(sourceEntity, i + 1)
59436
+ );
59435
59437
  }
59436
- result[sourceName] = Array.from(
59437
- { length: 10 },
59438
- (_, i) => generateEntityRow(sourceEntity, i + 1)
59439
- );
59438
+ const reboundName = trait.linkedEntity;
59439
+ if (!reboundName || reboundName === sourceName) continue;
59440
+ const reboundRows = result[reboundName];
59441
+ if (!reboundRows || reboundRows.length === 0) continue;
59442
+ reboundRows.forEach((row, i) => {
59443
+ for (const f3 of sourceEntity.fields) {
59444
+ if (f3.name === void 0 || f3.name === "id") continue;
59445
+ if (row[f3.name] !== void 0) continue;
59446
+ row[f3.name] = generateFieldValue(sourceName, f3, i + 1);
59447
+ }
59448
+ });
59440
59449
  }
59441
59450
  }
59442
59451
  perfEnd("build-mock-data", t, { orbitalCount: schema.orbitals.length, entityCount: Object.keys(result).length });
@@ -60328,13 +60337,24 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60328
60337
  const allTransitions = sm.transitions ?? [];
60329
60338
  const targetTransition = fromState && toState ? allTransitions.find((t) => t.event === transitionEvent && t.from === fromState && t.to === toState) ?? allTransitions.find((t) => t.event === transitionEvent) : allTransitions.find((t) => t.event === transitionEvent);
60330
60339
  if (!targetTransition?.effects) continue;
60331
- const renderUIEffects = [];
60340
+ const previewEffects = [];
60341
+ let hasRenderUI = false;
60332
60342
  for (const eff of targetTransition.effects) {
60333
- if (Array.isArray(eff) && eff[0] === "render-ui") {
60334
- renderUIEffects.push(eff);
60343
+ if (!Array.isArray(eff)) continue;
60344
+ const op = eff[0];
60345
+ if (op === "render-ui") {
60346
+ previewEffects.push(eff);
60347
+ hasRenderUI = true;
60348
+ continue;
60349
+ }
60350
+ if (op === "set") {
60351
+ const target = eff[1];
60352
+ if (typeof target === "string" && target.startsWith("@entity.")) {
60353
+ previewEffects.push(eff);
60354
+ }
60335
60355
  }
60336
60356
  }
60337
- if (renderUIEffects.length === 0) continue;
60357
+ if (!hasRenderUI) continue;
60338
60358
  const linkedEntity = traitObj.linkedEntity ?? entityNameOf(clonedOrbital.entity);
60339
60359
  const emitContract = findEmitContract(traitObj, transitionEvent);
60340
60360
  const mockPayload = generateMockPayload(
@@ -60343,7 +60363,7 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60343
60363
  linkedEntity,
60344
60364
  mockData
60345
60365
  );
60346
- const seededEffects = substitutePayloadBindings(renderUIEffects, mockPayload);
60366
+ const seededEffects = substitutePayloadBindings(previewEffects, mockPayload);
60347
60367
  traitObj.stateMachine = {
60348
60368
  states: [{ name: "preview", isInitial: true }],
60349
60369
  events: [{ key: "INIT", name: "INIT" }],
@@ -47263,15 +47263,24 @@ function buildMockData(schema) {
47263
47263
  const sourceEntity = trait.sourceEntityDefinition;
47264
47264
  if (!sourceEntity || core.isEntityCall(sourceEntity)) continue;
47265
47265
  const sourceName = sourceEntity.name;
47266
- if (!sourceName || result[sourceName]) continue;
47267
- if (sourceEntity.instances && sourceEntity.instances.length > 0) {
47268
- result[sourceName] = sourceEntity.instances;
47269
- continue;
47266
+ if (!sourceName) continue;
47267
+ if (!result[sourceName]) {
47268
+ result[sourceName] = sourceEntity.instances && sourceEntity.instances.length > 0 ? sourceEntity.instances : Array.from(
47269
+ { length: 10 },
47270
+ (_, i) => generateEntityRow(sourceEntity, i + 1)
47271
+ );
47270
47272
  }
47271
- result[sourceName] = Array.from(
47272
- { length: 10 },
47273
- (_, i) => generateEntityRow(sourceEntity, i + 1)
47274
- );
47273
+ const reboundName = trait.linkedEntity;
47274
+ if (!reboundName || reboundName === sourceName) continue;
47275
+ const reboundRows = result[reboundName];
47276
+ if (!reboundRows || reboundRows.length === 0) continue;
47277
+ reboundRows.forEach((row, i) => {
47278
+ for (const f3 of sourceEntity.fields) {
47279
+ if (f3.name === void 0 || f3.name === "id") continue;
47280
+ if (row[f3.name] !== void 0) continue;
47281
+ row[f3.name] = generateFieldValue(sourceName, f3, i + 1);
47282
+ }
47283
+ });
47275
47284
  }
47276
47285
  }
47277
47286
  perfEnd("build-mock-data", t, { orbitalCount: schema.orbitals.length, entityCount: Object.keys(result).length });
@@ -47217,15 +47217,24 @@ function buildMockData(schema) {
47217
47217
  const sourceEntity = trait.sourceEntityDefinition;
47218
47218
  if (!sourceEntity || isEntityCall(sourceEntity)) continue;
47219
47219
  const sourceName = sourceEntity.name;
47220
- if (!sourceName || result[sourceName]) continue;
47221
- if (sourceEntity.instances && sourceEntity.instances.length > 0) {
47222
- result[sourceName] = sourceEntity.instances;
47223
- continue;
47220
+ if (!sourceName) continue;
47221
+ if (!result[sourceName]) {
47222
+ result[sourceName] = sourceEntity.instances && sourceEntity.instances.length > 0 ? sourceEntity.instances : Array.from(
47223
+ { length: 10 },
47224
+ (_, i) => generateEntityRow(sourceEntity, i + 1)
47225
+ );
47224
47226
  }
47225
- result[sourceName] = Array.from(
47226
- { length: 10 },
47227
- (_, i) => generateEntityRow(sourceEntity, i + 1)
47228
- );
47227
+ const reboundName = trait.linkedEntity;
47228
+ if (!reboundName || reboundName === sourceName) continue;
47229
+ const reboundRows = result[reboundName];
47230
+ if (!reboundRows || reboundRows.length === 0) continue;
47231
+ reboundRows.forEach((row, i) => {
47232
+ for (const f3 of sourceEntity.fields) {
47233
+ if (f3.name === void 0 || f3.name === "id") continue;
47234
+ if (row[f3.name] !== void 0) continue;
47235
+ row[f3.name] = generateFieldValue(sourceName, f3, i + 1);
47236
+ }
47237
+ });
47229
47238
  }
47230
47239
  }
47231
47240
  perfEnd("build-mock-data", t, { orbitalCount: schema.orbitals.length, entityCount: Object.keys(result).length });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.54.1",
3
+ "version": "4.54.3",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [