@almadar/ui 2.9.1 → 2.9.2

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.
@@ -184,9 +184,14 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
184
184
  notify: optionsRef.current?.notify,
185
185
  enrichPattern: (pattern) => {
186
186
  const patternType = pattern?.type;
187
- if (linkedEntity && patternType && isEntityAwarePattern(patternType)) {
187
+ if (patternType && isEntityAwarePattern(patternType) && fetchedDataContext) {
188
188
  const patternRecord = pattern;
189
- if (!patternRecord.entity && fetchedDataContext) {
189
+ if (typeof patternRecord.entity === "string") {
190
+ const records = fetchedDataContext.getData(patternRecord.entity);
191
+ if (records.length > 0) {
192
+ return { type: patternType, ...patternRecord, entity: records };
193
+ }
194
+ } else if (!patternRecord.entity && linkedEntity) {
190
195
  const records = fetchedDataContext.getData(linkedEntity);
191
196
  if (records.length > 0) {
192
197
  return { type: patternType, ...patternRecord, entity: records };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",