@almadar/ui 2.60.5 → 2.61.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.
@@ -46671,6 +46671,15 @@ function SlotContentRenderer({
46671
46671
  const entityProp = content.props.entity;
46672
46672
  const entityType = typeof entityProp === "string" ? entityProp : "";
46673
46673
  const storeData = useEntityRef(entityType);
46674
+ React127__namespace.default.useEffect(() => {
46675
+ if (!entityType) return;
46676
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
46677
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
46678
+ STRING_ENTITY_WARNED.add(entityType);
46679
+ console.warn(
46680
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
46681
+ );
46682
+ }, [entityType]);
46674
46683
  const schemaCtx = useEntitySchemaOptional();
46675
46684
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
46676
46685
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -46682,18 +46691,21 @@ function SlotContentRenderer({
46682
46691
  const { children: _childrenConfig, ...restProps } = content.props;
46683
46692
  const renderedProps = renderPatternProps(restProps, onDismiss);
46684
46693
  let finalProps;
46694
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
46685
46695
  if (entityType) {
46686
46696
  finalProps = { ...renderedProps, entity: storeData };
46687
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
46688
- const sample = storeData[0];
46689
- if (sample && typeof sample === "object") {
46690
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46691
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46692
- }
46693
- }
46697
+ } else if (Array.isArray(renderedProps.items)) {
46698
+ finalProps = { ...renderedProps, entity: renderedProps.items };
46694
46699
  } else {
46695
46700
  finalProps = renderedProps;
46696
46701
  }
46702
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
46703
+ const sample = resolvedItems[0];
46704
+ if (sample && typeof sample === "object") {
46705
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46706
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46707
+ }
46708
+ }
46697
46709
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
46698
46710
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
46699
46711
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -46793,7 +46805,7 @@ function UISlotRenderer({
46793
46805
  }
46794
46806
  return wrapped;
46795
46807
  }
46796
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
46808
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
46797
46809
  var init_UISlotRenderer = __esm({
46798
46810
  "components/organisms/UISlotRenderer.tsx"() {
46799
46811
  "use client";
@@ -46812,6 +46824,7 @@ var init_UISlotRenderer = __esm({
46812
46824
  init_TraitFrame();
46813
46825
  init_component_registry_generated();
46814
46826
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
46827
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
46815
46828
  SuspenseConfigContext = React127.createContext({ enabled: false });
46816
46829
  SlotContainedContext = React127.createContext(false);
46817
46830
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
package/dist/avl/index.js CHANGED
@@ -46625,6 +46625,15 @@ function SlotContentRenderer({
46625
46625
  const entityProp = content.props.entity;
46626
46626
  const entityType = typeof entityProp === "string" ? entityProp : "";
46627
46627
  const storeData = useEntityRef(entityType);
46628
+ React127__default.useEffect(() => {
46629
+ if (!entityType) return;
46630
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
46631
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
46632
+ STRING_ENTITY_WARNED.add(entityType);
46633
+ console.warn(
46634
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
46635
+ );
46636
+ }, [entityType]);
46628
46637
  const schemaCtx = useEntitySchemaOptional();
46629
46638
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
46630
46639
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -46636,18 +46645,21 @@ function SlotContentRenderer({
46636
46645
  const { children: _childrenConfig, ...restProps } = content.props;
46637
46646
  const renderedProps = renderPatternProps(restProps, onDismiss);
46638
46647
  let finalProps;
46648
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
46639
46649
  if (entityType) {
46640
46650
  finalProps = { ...renderedProps, entity: storeData };
46641
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
46642
- const sample = storeData[0];
46643
- if (sample && typeof sample === "object") {
46644
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46645
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46646
- }
46647
- }
46651
+ } else if (Array.isArray(renderedProps.items)) {
46652
+ finalProps = { ...renderedProps, entity: renderedProps.items };
46648
46653
  } else {
46649
46654
  finalProps = renderedProps;
46650
46655
  }
46656
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
46657
+ const sample = resolvedItems[0];
46658
+ if (sample && typeof sample === "object") {
46659
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46660
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46661
+ }
46662
+ }
46651
46663
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
46652
46664
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
46653
46665
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -46747,7 +46759,7 @@ function UISlotRenderer({
46747
46759
  }
46748
46760
  return wrapped;
46749
46761
  }
46750
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
46762
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
46751
46763
  var init_UISlotRenderer = __esm({
46752
46764
  "components/organisms/UISlotRenderer.tsx"() {
46753
46765
  "use client";
@@ -46766,6 +46778,7 @@ var init_UISlotRenderer = __esm({
46766
46778
  init_TraitFrame();
46767
46779
  init_component_registry_generated();
46768
46780
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
46781
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
46769
46782
  SuspenseConfigContext = createContext({ enabled: false });
46770
46783
  SlotContainedContext = createContext(false);
46771
46784
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -37493,6 +37493,15 @@ function SlotContentRenderer({
37493
37493
  const entityProp = content.props.entity;
37494
37494
  const entityType = typeof entityProp === "string" ? entityProp : "";
37495
37495
  const storeData = providers.useEntityRef(entityType);
37496
+ React110__namespace.default.useEffect(() => {
37497
+ if (!entityType) return;
37498
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37499
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
37500
+ STRING_ENTITY_WARNED.add(entityType);
37501
+ console.warn(
37502
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37503
+ );
37504
+ }, [entityType]);
37496
37505
  const schemaCtx = useEntitySchemaOptional();
37497
37506
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37498
37507
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37504,18 +37513,21 @@ function SlotContentRenderer({
37504
37513
  const { children: _childrenConfig, ...restProps } = content.props;
37505
37514
  const renderedProps = renderPatternProps(restProps, onDismiss);
37506
37515
  let finalProps;
37516
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37507
37517
  if (entityType) {
37508
37518
  finalProps = { ...renderedProps, entity: storeData };
37509
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37510
- const sample = storeData[0];
37511
- if (sample && typeof sample === "object") {
37512
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37513
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37514
- }
37515
- }
37519
+ } else if (Array.isArray(renderedProps.items)) {
37520
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37516
37521
  } else {
37517
37522
  finalProps = renderedProps;
37518
37523
  }
37524
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37525
+ const sample = resolvedItems[0];
37526
+ if (sample && typeof sample === "object") {
37527
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37528
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37529
+ }
37530
+ }
37519
37531
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37520
37532
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37521
37533
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37615,7 +37627,7 @@ function UISlotRenderer({
37615
37627
  }
37616
37628
  return wrapped;
37617
37629
  }
37618
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37630
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37619
37631
  var init_UISlotRenderer = __esm({
37620
37632
  "components/organisms/UISlotRenderer.tsx"() {
37621
37633
  "use client";
@@ -37632,6 +37644,7 @@ var init_UISlotRenderer = __esm({
37632
37644
  init_TraitFrame();
37633
37645
  init_component_registry_generated();
37634
37646
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37647
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37635
37648
  SuspenseConfigContext = React110.createContext({ enabled: false });
37636
37649
  SlotContainedContext = React110.createContext(false);
37637
37650
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -37448,6 +37448,15 @@ function SlotContentRenderer({
37448
37448
  const entityProp = content.props.entity;
37449
37449
  const entityType = typeof entityProp === "string" ? entityProp : "";
37450
37450
  const storeData = useEntityRef(entityType);
37451
+ React110__default.useEffect(() => {
37452
+ if (!entityType) return;
37453
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37454
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
37455
+ STRING_ENTITY_WARNED.add(entityType);
37456
+ console.warn(
37457
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37458
+ );
37459
+ }, [entityType]);
37451
37460
  const schemaCtx = useEntitySchemaOptional();
37452
37461
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37453
37462
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37459,18 +37468,21 @@ function SlotContentRenderer({
37459
37468
  const { children: _childrenConfig, ...restProps } = content.props;
37460
37469
  const renderedProps = renderPatternProps(restProps, onDismiss);
37461
37470
  let finalProps;
37471
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37462
37472
  if (entityType) {
37463
37473
  finalProps = { ...renderedProps, entity: storeData };
37464
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37465
- const sample = storeData[0];
37466
- if (sample && typeof sample === "object") {
37467
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37468
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37469
- }
37470
- }
37474
+ } else if (Array.isArray(renderedProps.items)) {
37475
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37471
37476
  } else {
37472
37477
  finalProps = renderedProps;
37473
37478
  }
37479
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37480
+ const sample = resolvedItems[0];
37481
+ if (sample && typeof sample === "object") {
37482
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37483
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37484
+ }
37485
+ }
37474
37486
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37475
37487
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37476
37488
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37570,7 +37582,7 @@ function UISlotRenderer({
37570
37582
  }
37571
37583
  return wrapped;
37572
37584
  }
37573
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37585
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37574
37586
  var init_UISlotRenderer = __esm({
37575
37587
  "components/organisms/UISlotRenderer.tsx"() {
37576
37588
  "use client";
@@ -37587,6 +37599,7 @@ var init_UISlotRenderer = __esm({
37587
37599
  init_TraitFrame();
37588
37600
  init_component_registry_generated();
37589
37601
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37602
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37590
37603
  SuspenseConfigContext = createContext({ enabled: false });
37591
37604
  SlotContainedContext = createContext(false);
37592
37605
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -36,8 +36,26 @@ export interface SelectPayload {
36
36
  ids: (string | number)[];
37
37
  }
38
38
  export interface EntityDisplayProps<T = unknown> {
39
- /** Entity name (string) or data injected by the runtime (array for lists, single object for detail) */
39
+ /**
40
+ * Entity data or a legacy entity-name string.
41
+ *
42
+ * V2 Phase 2 accepts three shapes here (value-first is the canonical path):
43
+ * - `readonly T[]`: pre-resolved array for list patterns.
44
+ * - `T`: pre-resolved single record for detail patterns.
45
+ * - `string`: legacy entity-type name resolved by the renderer via
46
+ * `useEntityRef`. Emits a dev-mode deprecation warning; removal
47
+ * scheduled for Phase 6 of docs/Almadar_Entity_V2_Plan.md.
48
+ *
49
+ * Prefer `items` for list shapes so organisms never depend on the
50
+ * renderer's string resolution at all.
51
+ */
40
52
  entity?: string | T | readonly T[];
53
+ /**
54
+ * Pre-resolved list of records. V2 Phase 2 addition. When set, organisms
55
+ * should read data from here instead of `entity`. Resolving from the
56
+ * calling trait's `@payload.data` is the authoring pattern.
57
+ */
58
+ items?: readonly T[];
41
59
  /** Additional CSS classes */
42
60
  className?: string;
43
61
  /** Loading state indicator */
@@ -38003,6 +38003,15 @@ function SlotContentRenderer({
38003
38003
  const entityProp = content.props.entity;
38004
38004
  const entityType = typeof entityProp === "string" ? entityProp : "";
38005
38005
  const storeData = providers.useEntityRef(entityType);
38006
+ React116__namespace.default.useEffect(() => {
38007
+ if (!entityType) return;
38008
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
38009
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
38010
+ STRING_ENTITY_WARNED.add(entityType);
38011
+ console.warn(
38012
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
38013
+ );
38014
+ }, [entityType]);
38006
38015
  const schemaCtx = useEntitySchemaOptional();
38007
38016
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
38008
38017
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -38014,18 +38023,21 @@ function SlotContentRenderer({
38014
38023
  const { children: _childrenConfig, ...restProps } = content.props;
38015
38024
  const renderedProps = renderPatternProps(restProps, onDismiss);
38016
38025
  let finalProps;
38026
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
38017
38027
  if (entityType) {
38018
38028
  finalProps = { ...renderedProps, entity: storeData };
38019
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
38020
- const sample = storeData[0];
38021
- if (sample && typeof sample === "object") {
38022
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
38023
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
38024
- }
38025
- }
38029
+ } else if (Array.isArray(renderedProps.items)) {
38030
+ finalProps = { ...renderedProps, entity: renderedProps.items };
38026
38031
  } else {
38027
38032
  finalProps = renderedProps;
38028
38033
  }
38034
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
38035
+ const sample = resolvedItems[0];
38036
+ if (sample && typeof sample === "object") {
38037
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
38038
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
38039
+ }
38040
+ }
38029
38041
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
38030
38042
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
38031
38043
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -38125,7 +38137,7 @@ function UISlotRenderer({
38125
38137
  }
38126
38138
  return wrapped;
38127
38139
  }
38128
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
38140
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
38129
38141
  var init_UISlotRenderer = __esm({
38130
38142
  "components/organisms/UISlotRenderer.tsx"() {
38131
38143
  "use client";
@@ -38142,6 +38154,7 @@ var init_UISlotRenderer = __esm({
38142
38154
  init_TraitFrame();
38143
38155
  init_component_registry_generated();
38144
38156
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
38157
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
38145
38158
  SuspenseConfigContext = React116.createContext({ enabled: false });
38146
38159
  SlotContainedContext = React116.createContext(false);
38147
38160
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -37958,6 +37958,15 @@ function SlotContentRenderer({
37958
37958
  const entityProp = content.props.entity;
37959
37959
  const entityType = typeof entityProp === "string" ? entityProp : "";
37960
37960
  const storeData = useEntityRef$1(entityType);
37961
+ React116__default.useEffect(() => {
37962
+ if (!entityType) return;
37963
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37964
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
37965
+ STRING_ENTITY_WARNED.add(entityType);
37966
+ console.warn(
37967
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37968
+ );
37969
+ }, [entityType]);
37961
37970
  const schemaCtx = useEntitySchemaOptional();
37962
37971
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37963
37972
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37969,18 +37978,21 @@ function SlotContentRenderer({
37969
37978
  const { children: _childrenConfig, ...restProps } = content.props;
37970
37979
  const renderedProps = renderPatternProps(restProps, onDismiss);
37971
37980
  let finalProps;
37981
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37972
37982
  if (entityType) {
37973
37983
  finalProps = { ...renderedProps, entity: storeData };
37974
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37975
- const sample = storeData[0];
37976
- if (sample && typeof sample === "object") {
37977
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37978
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37979
- }
37980
- }
37984
+ } else if (Array.isArray(renderedProps.items)) {
37985
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37981
37986
  } else {
37982
37987
  finalProps = renderedProps;
37983
37988
  }
37989
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37990
+ const sample = resolvedItems[0];
37991
+ if (sample && typeof sample === "object") {
37992
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37993
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37994
+ }
37995
+ }
37984
37996
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37985
37997
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37986
37998
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -38080,7 +38092,7 @@ function UISlotRenderer({
38080
38092
  }
38081
38093
  return wrapped;
38082
38094
  }
38083
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
38095
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
38084
38096
  var init_UISlotRenderer = __esm({
38085
38097
  "components/organisms/UISlotRenderer.tsx"() {
38086
38098
  "use client";
@@ -38097,6 +38109,7 @@ var init_UISlotRenderer = __esm({
38097
38109
  init_TraitFrame();
38098
38110
  init_component_registry_generated();
38099
38111
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
38112
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
38100
38113
  SuspenseConfigContext = createContext({ enabled: false });
38101
38114
  SlotContainedContext = createContext(false);
38102
38115
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -37576,6 +37576,15 @@ function SlotContentRenderer({
37576
37576
  const entityProp = content.props.entity;
37577
37577
  const entityType = typeof entityProp === "string" ? entityProp : "";
37578
37578
  const storeData = providers.useEntityRef(entityType);
37579
+ React116__namespace.default.useEffect(() => {
37580
+ if (!entityType) return;
37581
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37582
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
37583
+ STRING_ENTITY_WARNED.add(entityType);
37584
+ console.warn(
37585
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37586
+ );
37587
+ }, [entityType]);
37579
37588
  const schemaCtx = useEntitySchemaOptional();
37580
37589
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37581
37590
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37587,18 +37596,21 @@ function SlotContentRenderer({
37587
37596
  const { children: _childrenConfig, ...restProps } = content.props;
37588
37597
  const renderedProps = renderPatternProps(restProps, onDismiss);
37589
37598
  let finalProps;
37599
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37590
37600
  if (entityType) {
37591
37601
  finalProps = { ...renderedProps, entity: storeData };
37592
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37593
- const sample = storeData[0];
37594
- if (sample && typeof sample === "object") {
37595
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37596
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37597
- }
37598
- }
37602
+ } else if (Array.isArray(renderedProps.items)) {
37603
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37599
37604
  } else {
37600
37605
  finalProps = renderedProps;
37601
37606
  }
37607
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37608
+ const sample = resolvedItems[0];
37609
+ if (sample && typeof sample === "object") {
37610
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37611
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37612
+ }
37613
+ }
37602
37614
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37603
37615
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37604
37616
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37698,7 +37710,7 @@ function UISlotRenderer({
37698
37710
  }
37699
37711
  return wrapped;
37700
37712
  }
37701
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37713
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37702
37714
  var init_UISlotRenderer = __esm({
37703
37715
  "components/organisms/UISlotRenderer.tsx"() {
37704
37716
  "use client";
@@ -37715,6 +37727,7 @@ var init_UISlotRenderer = __esm({
37715
37727
  init_TraitFrame();
37716
37728
  init_component_registry_generated();
37717
37729
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37730
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37718
37731
  SuspenseConfigContext = React116.createContext({ enabled: false });
37719
37732
  SlotContainedContext = React116.createContext(false);
37720
37733
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -37531,6 +37531,15 @@ function SlotContentRenderer({
37531
37531
  const entityProp = content.props.entity;
37532
37532
  const entityType = typeof entityProp === "string" ? entityProp : "";
37533
37533
  const storeData = useEntityRef(entityType);
37534
+ React116__default.useEffect(() => {
37535
+ if (!entityType) return;
37536
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37537
+ if (STRING_ENTITY_WARNED.has(entityType)) return;
37538
+ STRING_ENTITY_WARNED.add(entityType);
37539
+ console.warn(
37540
+ `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37541
+ );
37542
+ }, [entityType]);
37534
37543
  const schemaCtx = useEntitySchemaOptional();
37535
37544
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37536
37545
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37542,18 +37551,21 @@ function SlotContentRenderer({
37542
37551
  const { children: _childrenConfig, ...restProps } = content.props;
37543
37552
  const renderedProps = renderPatternProps(restProps, onDismiss);
37544
37553
  let finalProps;
37554
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37545
37555
  if (entityType) {
37546
37556
  finalProps = { ...renderedProps, entity: storeData };
37547
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37548
- const sample = storeData[0];
37549
- if (sample && typeof sample === "object") {
37550
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37551
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37552
- }
37553
- }
37557
+ } else if (Array.isArray(renderedProps.items)) {
37558
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37554
37559
  } else {
37555
37560
  finalProps = renderedProps;
37556
37561
  }
37562
+ if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37563
+ const sample = resolvedItems[0];
37564
+ if (sample && typeof sample === "object") {
37565
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37566
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37567
+ }
37568
+ }
37557
37569
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37558
37570
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37559
37571
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37653,7 +37665,7 @@ function UISlotRenderer({
37653
37665
  }
37654
37666
  return wrapped;
37655
37667
  }
37656
- var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37668
+ var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37657
37669
  var init_UISlotRenderer = __esm({
37658
37670
  "components/organisms/UISlotRenderer.tsx"() {
37659
37671
  "use client";
@@ -37670,6 +37682,7 @@ var init_UISlotRenderer = __esm({
37670
37682
  init_TraitFrame();
37671
37683
  init_component_registry_generated();
37672
37684
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37685
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37673
37686
  SuspenseConfigContext = createContext({ enabled: false });
37674
37687
  SlotContainedContext = createContext(false);
37675
37688
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.60.5",
3
+ "version": "2.61.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",