@almadar/ui 2.11.4 → 2.11.5

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.
@@ -193,7 +193,14 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
193
193
  );
194
194
  const linkedEntity = binding.linkedEntity || "";
195
195
  const entityId = payload?.entityId;
196
- const entityData = linkedEntity && entityId && fetchedDataContext ? fetchedDataContext.getById(linkedEntity, entityId) || {} : payload || {};
196
+ const entityData = (() => {
197
+ if (!linkedEntity || !fetchedDataContext) return payload || {};
198
+ if (entityId) {
199
+ return fetchedDataContext.getById(linkedEntity, entityId) || {};
200
+ }
201
+ const records = fetchedDataContext.getData(linkedEntity);
202
+ return records[0] || payload || {};
203
+ })();
197
204
  const pendingSlots = /* @__PURE__ */ new Map();
198
205
  const slotSource = {
199
206
  trait: binding.trait.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.11.4",
3
+ "version": "2.11.5",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",