@almadar/ui 2.60.5 → 2.61.1

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);
@@ -46684,16 +46693,19 @@ function SlotContentRenderer({
46684
46693
  let finalProps;
46685
46694
  if (entityType) {
46686
46695
  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
- }
46694
46696
  } else {
46695
46697
  finalProps = renderedProps;
46696
46698
  }
46699
+ const resolvedItems = Array.isArray(
46700
+ finalProps.entity
46701
+ ) ? finalProps.entity : null;
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);
@@ -46638,16 +46647,19 @@ function SlotContentRenderer({
46638
46647
  let finalProps;
46639
46648
  if (entityType) {
46640
46649
  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
- }
46648
46650
  } else {
46649
46651
  finalProps = renderedProps;
46650
46652
  }
46653
+ const resolvedItems = Array.isArray(
46654
+ finalProps.entity
46655
+ ) ? finalProps.entity : null;
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);
@@ -37506,16 +37515,19 @@ function SlotContentRenderer({
37506
37515
  let finalProps;
37507
37516
  if (entityType) {
37508
37517
  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
- }
37516
37518
  } else {
37517
37519
  finalProps = renderedProps;
37518
37520
  }
37521
+ const resolvedItems = Array.isArray(
37522
+ finalProps.entity
37523
+ ) ? finalProps.entity : null;
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);
@@ -37461,16 +37470,19 @@ function SlotContentRenderer({
37461
37470
  let finalProps;
37462
37471
  if (entityType) {
37463
37472
  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
- }
37471
37473
  } else {
37472
37474
  finalProps = renderedProps;
37473
37475
  }
37476
+ const resolvedItems = Array.isArray(
37477
+ finalProps.entity
37478
+ ) ? finalProps.entity : null;
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,7 +36,19 @@ 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
+ * Accepts three shapes today; the string branch is deprecated:
43
+ * - `readonly T[]`: pre-resolved array for list patterns (authoring
44
+ * pattern: `entity: @payload.data` from the calling trait).
45
+ * - `T`: pre-resolved single record for detail patterns.
46
+ * - `string`: legacy entity-type name resolved by the renderer via
47
+ * `useEntityRef`. Emits a dev-mode deprecation warning. Removal
48
+ * scheduled for Phase 6 of docs/Almadar_Entity_V2_Plan.md when the
49
+ * entity store itself is deleted; the prop shape will collapse to
50
+ * `readonly T[] | T | undefined`.
51
+ */
40
52
  entity?: string | T | readonly T[];
41
53
  /** Additional CSS classes */
42
54
  className?: string;
@@ -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);
@@ -38016,16 +38025,19 @@ function SlotContentRenderer({
38016
38025
  let finalProps;
38017
38026
  if (entityType) {
38018
38027
  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
- }
38026
38028
  } else {
38027
38029
  finalProps = renderedProps;
38028
38030
  }
38031
+ const resolvedItems = Array.isArray(
38032
+ finalProps.entity
38033
+ ) ? finalProps.entity : null;
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);
@@ -37971,16 +37980,19 @@ function SlotContentRenderer({
37971
37980
  let finalProps;
37972
37981
  if (entityType) {
37973
37982
  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
- }
37981
37983
  } else {
37982
37984
  finalProps = renderedProps;
37983
37985
  }
37986
+ const resolvedItems = Array.isArray(
37987
+ finalProps.entity
37988
+ ) ? finalProps.entity : null;
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);
@@ -37589,16 +37598,19 @@ function SlotContentRenderer({
37589
37598
  let finalProps;
37590
37599
  if (entityType) {
37591
37600
  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
- }
37599
37601
  } else {
37600
37602
  finalProps = renderedProps;
37601
37603
  }
37604
+ const resolvedItems = Array.isArray(
37605
+ finalProps.entity
37606
+ ) ? finalProps.entity : null;
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);
@@ -37544,16 +37553,19 @@ function SlotContentRenderer({
37544
37553
  let finalProps;
37545
37554
  if (entityType) {
37546
37555
  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
- }
37554
37556
  } else {
37555
37557
  finalProps = renderedProps;
37556
37558
  }
37559
+ const resolvedItems = Array.isArray(
37560
+ finalProps.entity
37561
+ ) ? finalProps.entity : null;
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.1",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",