@almadar/ui 2.60.4 → 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.
@@ -19317,7 +19317,8 @@ var init_Carousel = __esm({
19317
19317
  const scrollRef = React127.useRef(null);
19318
19318
  const autoPlayRef = React127.useRef(null);
19319
19319
  const eventBus = useSafeEventBus3();
19320
- const totalSlides = items.length;
19320
+ const safeItems = items ?? [];
19321
+ const totalSlides = safeItems.length;
19321
19322
  const emitSlideChange = React127.useCallback(
19322
19323
  (newIndex) => {
19323
19324
  if (slideChangeEvent) {
@@ -19428,7 +19429,7 @@ var init_Carousel = __esm({
19428
19429
  onPointerMove: swipeHandlers.onPointerMove,
19429
19430
  onPointerUp: swipeHandlers.onPointerUp,
19430
19431
  onPointerCancel: swipeHandlers.onPointerCancel,
19431
- children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
19432
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
19432
19433
  Box,
19433
19434
  {
19434
19435
  className: cn(
@@ -19497,7 +19498,7 @@ var init_Carousel = __esm({
19497
19498
  {
19498
19499
  position: "absolute",
19499
19500
  className: "bottom-3 left-0 right-0 z-10",
19500
- children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
19501
+ children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
19501
19502
  const isActive = index === activeIndex;
19502
19503
  return /* @__PURE__ */ jsxRuntime.jsx(
19503
19504
  Box,
@@ -46428,7 +46429,7 @@ function UISlotComponent({
46428
46429
  );
46429
46430
  }
46430
46431
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
46431
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React127.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
46432
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React127.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
46432
46433
  return /* @__PURE__ */ jsxRuntime.jsx(
46433
46434
  Box,
46434
46435
  {
@@ -46670,6 +46671,15 @@ function SlotContentRenderer({
46670
46671
  const entityProp = content.props.entity;
46671
46672
  const entityType = typeof entityProp === "string" ? entityProp : "";
46672
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]);
46673
46683
  const schemaCtx = useEntitySchemaOptional();
46674
46684
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
46675
46685
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -46681,18 +46691,21 @@ function SlotContentRenderer({
46681
46691
  const { children: _childrenConfig, ...restProps } = content.props;
46682
46692
  const renderedProps = renderPatternProps(restProps, onDismiss);
46683
46693
  let finalProps;
46694
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
46684
46695
  if (entityType) {
46685
46696
  finalProps = { ...renderedProps, entity: storeData };
46686
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
46687
- const sample = storeData[0];
46688
- if (sample && typeof sample === "object") {
46689
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46690
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46691
- }
46692
- }
46697
+ } else if (Array.isArray(renderedProps.items)) {
46698
+ finalProps = { ...renderedProps, entity: renderedProps.items };
46693
46699
  } else {
46694
46700
  finalProps = renderedProps;
46695
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
+ }
46696
46709
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
46697
46710
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
46698
46711
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -46792,7 +46805,7 @@ function UISlotRenderer({
46792
46805
  }
46793
46806
  return wrapped;
46794
46807
  }
46795
- 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;
46796
46809
  var init_UISlotRenderer = __esm({
46797
46810
  "components/organisms/UISlotRenderer.tsx"() {
46798
46811
  "use client";
@@ -46811,6 +46824,7 @@ var init_UISlotRenderer = __esm({
46811
46824
  init_TraitFrame();
46812
46825
  init_component_registry_generated();
46813
46826
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
46827
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
46814
46828
  SuspenseConfigContext = React127.createContext({ enabled: false });
46815
46829
  SlotContainedContext = React127.createContext(false);
46816
46830
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
package/dist/avl/index.js CHANGED
@@ -19271,7 +19271,8 @@ var init_Carousel = __esm({
19271
19271
  const scrollRef = useRef(null);
19272
19272
  const autoPlayRef = useRef(null);
19273
19273
  const eventBus = useSafeEventBus3();
19274
- const totalSlides = items.length;
19274
+ const safeItems = items ?? [];
19275
+ const totalSlides = safeItems.length;
19275
19276
  const emitSlideChange = useCallback(
19276
19277
  (newIndex) => {
19277
19278
  if (slideChangeEvent) {
@@ -19382,7 +19383,7 @@ var init_Carousel = __esm({
19382
19383
  onPointerMove: swipeHandlers.onPointerMove,
19383
19384
  onPointerUp: swipeHandlers.onPointerUp,
19384
19385
  onPointerCancel: swipeHandlers.onPointerCancel,
19385
- children: items.map((item, index) => /* @__PURE__ */ jsx(
19386
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
19386
19387
  Box,
19387
19388
  {
19388
19389
  className: cn(
@@ -19451,7 +19452,7 @@ var init_Carousel = __esm({
19451
19452
  {
19452
19453
  position: "absolute",
19453
19454
  className: "bottom-3 left-0 right-0 z-10",
19454
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
19455
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
19455
19456
  const isActive = index === activeIndex;
19456
19457
  return /* @__PURE__ */ jsx(
19457
19458
  Box,
@@ -46382,7 +46383,7 @@ function UISlotComponent({
46382
46383
  );
46383
46384
  }
46384
46385
  const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
46385
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
46386
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
46386
46387
  return /* @__PURE__ */ jsx(
46387
46388
  Box,
46388
46389
  {
@@ -46624,6 +46625,15 @@ function SlotContentRenderer({
46624
46625
  const entityProp = content.props.entity;
46625
46626
  const entityType = typeof entityProp === "string" ? entityProp : "";
46626
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]);
46627
46637
  const schemaCtx = useEntitySchemaOptional();
46628
46638
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
46629
46639
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -46635,18 +46645,21 @@ function SlotContentRenderer({
46635
46645
  const { children: _childrenConfig, ...restProps } = content.props;
46636
46646
  const renderedProps = renderPatternProps(restProps, onDismiss);
46637
46647
  let finalProps;
46648
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
46638
46649
  if (entityType) {
46639
46650
  finalProps = { ...renderedProps, entity: storeData };
46640
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
46641
- const sample = storeData[0];
46642
- if (sample && typeof sample === "object") {
46643
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46644
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46645
- }
46646
- }
46651
+ } else if (Array.isArray(renderedProps.items)) {
46652
+ finalProps = { ...renderedProps, entity: renderedProps.items };
46647
46653
  } else {
46648
46654
  finalProps = renderedProps;
46649
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
+ }
46650
46663
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
46651
46664
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
46652
46665
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -46746,7 +46759,7 @@ function UISlotRenderer({
46746
46759
  }
46747
46760
  return wrapped;
46748
46761
  }
46749
- 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;
46750
46763
  var init_UISlotRenderer = __esm({
46751
46764
  "components/organisms/UISlotRenderer.tsx"() {
46752
46765
  "use client";
@@ -46765,6 +46778,7 @@ var init_UISlotRenderer = __esm({
46765
46778
  init_TraitFrame();
46766
46779
  init_component_registry_generated();
46767
46780
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
46781
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
46768
46782
  SuspenseConfigContext = createContext({ enabled: false });
46769
46783
  SlotContainedContext = createContext(false);
46770
46784
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -14590,7 +14590,8 @@ var init_Carousel = __esm({
14590
14590
  const scrollRef = React110.useRef(null);
14591
14591
  const autoPlayRef = React110.useRef(null);
14592
14592
  const eventBus = useSafeEventBus3();
14593
- const totalSlides = items.length;
14593
+ const safeItems = items ?? [];
14594
+ const totalSlides = safeItems.length;
14594
14595
  const emitSlideChange = React110.useCallback(
14595
14596
  (newIndex) => {
14596
14597
  if (slideChangeEvent) {
@@ -14701,7 +14702,7 @@ var init_Carousel = __esm({
14701
14702
  onPointerMove: swipeHandlers.onPointerMove,
14702
14703
  onPointerUp: swipeHandlers.onPointerUp,
14703
14704
  onPointerCancel: swipeHandlers.onPointerCancel,
14704
- children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
14705
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
14705
14706
  exports.Box,
14706
14707
  {
14707
14708
  className: cn(
@@ -14770,7 +14771,7 @@ var init_Carousel = __esm({
14770
14771
  {
14771
14772
  position: "absolute",
14772
14773
  className: "bottom-3 left-0 right-0 z-10",
14773
- children: /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
14774
+ children: /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
14774
14775
  const isActive = index === activeIndex;
14775
14776
  return /* @__PURE__ */ jsxRuntime.jsx(
14776
14777
  exports.Box,
@@ -37250,7 +37251,7 @@ function UISlotComponent({
37250
37251
  );
37251
37252
  }
37252
37253
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37253
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React110.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37254
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React110.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: slotContent });
37254
37255
  return /* @__PURE__ */ jsxRuntime.jsx(
37255
37256
  exports.Box,
37256
37257
  {
@@ -37492,6 +37493,15 @@ function SlotContentRenderer({
37492
37493
  const entityProp = content.props.entity;
37493
37494
  const entityType = typeof entityProp === "string" ? entityProp : "";
37494
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]);
37495
37505
  const schemaCtx = useEntitySchemaOptional();
37496
37506
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37497
37507
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37503,18 +37513,21 @@ function SlotContentRenderer({
37503
37513
  const { children: _childrenConfig, ...restProps } = content.props;
37504
37514
  const renderedProps = renderPatternProps(restProps, onDismiss);
37505
37515
  let finalProps;
37516
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37506
37517
  if (entityType) {
37507
37518
  finalProps = { ...renderedProps, entity: storeData };
37508
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37509
- const sample = storeData[0];
37510
- if (sample && typeof sample === "object") {
37511
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37512
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37513
- }
37514
- }
37519
+ } else if (Array.isArray(renderedProps.items)) {
37520
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37515
37521
  } else {
37516
37522
  finalProps = renderedProps;
37517
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
+ }
37518
37531
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37519
37532
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37520
37533
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37614,7 +37627,7 @@ function UISlotRenderer({
37614
37627
  }
37615
37628
  return wrapped;
37616
37629
  }
37617
- 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;
37618
37631
  var init_UISlotRenderer = __esm({
37619
37632
  "components/organisms/UISlotRenderer.tsx"() {
37620
37633
  "use client";
@@ -37631,6 +37644,7 @@ var init_UISlotRenderer = __esm({
37631
37644
  init_TraitFrame();
37632
37645
  init_component_registry_generated();
37633
37646
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37647
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37634
37648
  SuspenseConfigContext = React110.createContext({ enabled: false });
37635
37649
  SlotContainedContext = React110.createContext(false);
37636
37650
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -14545,7 +14545,8 @@ var init_Carousel = __esm({
14545
14545
  const scrollRef = useRef(null);
14546
14546
  const autoPlayRef = useRef(null);
14547
14547
  const eventBus = useSafeEventBus3();
14548
- const totalSlides = items.length;
14548
+ const safeItems = items ?? [];
14549
+ const totalSlides = safeItems.length;
14549
14550
  const emitSlideChange = useCallback(
14550
14551
  (newIndex) => {
14551
14552
  if (slideChangeEvent) {
@@ -14656,7 +14657,7 @@ var init_Carousel = __esm({
14656
14657
  onPointerMove: swipeHandlers.onPointerMove,
14657
14658
  onPointerUp: swipeHandlers.onPointerUp,
14658
14659
  onPointerCancel: swipeHandlers.onPointerCancel,
14659
- children: items.map((item, index) => /* @__PURE__ */ jsx(
14660
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
14660
14661
  Box,
14661
14662
  {
14662
14663
  className: cn(
@@ -14725,7 +14726,7 @@ var init_Carousel = __esm({
14725
14726
  {
14726
14727
  position: "absolute",
14727
14728
  className: "bottom-3 left-0 right-0 z-10",
14728
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
14729
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
14729
14730
  const isActive = index === activeIndex;
14730
14731
  return /* @__PURE__ */ jsx(
14731
14732
  Box,
@@ -37205,7 +37206,7 @@ function UISlotComponent({
37205
37206
  );
37206
37207
  }
37207
37208
  const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37208
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37209
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
37209
37210
  return /* @__PURE__ */ jsx(
37210
37211
  Box,
37211
37212
  {
@@ -37447,6 +37448,15 @@ function SlotContentRenderer({
37447
37448
  const entityProp = content.props.entity;
37448
37449
  const entityType = typeof entityProp === "string" ? entityProp : "";
37449
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]);
37450
37460
  const schemaCtx = useEntitySchemaOptional();
37451
37461
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37452
37462
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37458,18 +37468,21 @@ function SlotContentRenderer({
37458
37468
  const { children: _childrenConfig, ...restProps } = content.props;
37459
37469
  const renderedProps = renderPatternProps(restProps, onDismiss);
37460
37470
  let finalProps;
37471
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37461
37472
  if (entityType) {
37462
37473
  finalProps = { ...renderedProps, entity: storeData };
37463
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37464
- const sample = storeData[0];
37465
- if (sample && typeof sample === "object") {
37466
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37467
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37468
- }
37469
- }
37474
+ } else if (Array.isArray(renderedProps.items)) {
37475
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37470
37476
  } else {
37471
37477
  finalProps = renderedProps;
37472
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
+ }
37473
37486
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37474
37487
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37475
37488
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37569,7 +37582,7 @@ function UISlotRenderer({
37569
37582
  }
37570
37583
  return wrapped;
37571
37584
  }
37572
- 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;
37573
37586
  var init_UISlotRenderer = __esm({
37574
37587
  "components/organisms/UISlotRenderer.tsx"() {
37575
37588
  "use client";
@@ -37586,6 +37599,7 @@ var init_UISlotRenderer = __esm({
37586
37599
  init_TraitFrame();
37587
37600
  init_component_registry_generated();
37588
37601
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37602
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37589
37603
  SuspenseConfigContext = createContext({ enabled: false });
37590
37604
  SlotContainedContext = createContext(false);
37591
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 */
@@ -16134,7 +16134,8 @@ var init_Carousel = __esm({
16134
16134
  const scrollRef = React116.useRef(null);
16135
16135
  const autoPlayRef = React116.useRef(null);
16136
16136
  const eventBus = useSafeEventBus3();
16137
- const totalSlides = items.length;
16137
+ const safeItems = items ?? [];
16138
+ const totalSlides = safeItems.length;
16138
16139
  const emitSlideChange = React116.useCallback(
16139
16140
  (newIndex) => {
16140
16141
  if (slideChangeEvent) {
@@ -16245,7 +16246,7 @@ var init_Carousel = __esm({
16245
16246
  onPointerMove: swipeHandlers.onPointerMove,
16246
16247
  onPointerUp: swipeHandlers.onPointerUp,
16247
16248
  onPointerCancel: swipeHandlers.onPointerCancel,
16248
- children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
16249
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
16249
16250
  Box,
16250
16251
  {
16251
16252
  className: cn(
@@ -16314,7 +16315,7 @@ var init_Carousel = __esm({
16314
16315
  {
16315
16316
  position: "absolute",
16316
16317
  className: "bottom-3 left-0 right-0 z-10",
16317
- children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
16318
+ children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
16318
16319
  const isActive = index === activeIndex;
16319
16320
  return /* @__PURE__ */ jsxRuntime.jsx(
16320
16321
  Box,
@@ -37760,7 +37761,7 @@ function UISlotComponent({
37760
37761
  );
37761
37762
  }
37762
37763
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37763
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37764
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
37764
37765
  return /* @__PURE__ */ jsxRuntime.jsx(
37765
37766
  Box,
37766
37767
  {
@@ -38002,6 +38003,15 @@ function SlotContentRenderer({
38002
38003
  const entityProp = content.props.entity;
38003
38004
  const entityType = typeof entityProp === "string" ? entityProp : "";
38004
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]);
38005
38015
  const schemaCtx = useEntitySchemaOptional();
38006
38016
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
38007
38017
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -38013,18 +38023,21 @@ function SlotContentRenderer({
38013
38023
  const { children: _childrenConfig, ...restProps } = content.props;
38014
38024
  const renderedProps = renderPatternProps(restProps, onDismiss);
38015
38025
  let finalProps;
38026
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
38016
38027
  if (entityType) {
38017
38028
  finalProps = { ...renderedProps, entity: storeData };
38018
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
38019
- const sample = storeData[0];
38020
- if (sample && typeof sample === "object") {
38021
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
38022
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
38023
- }
38024
- }
38029
+ } else if (Array.isArray(renderedProps.items)) {
38030
+ finalProps = { ...renderedProps, entity: renderedProps.items };
38025
38031
  } else {
38026
38032
  finalProps = renderedProps;
38027
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
+ }
38028
38041
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
38029
38042
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
38030
38043
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -38124,7 +38137,7 @@ function UISlotRenderer({
38124
38137
  }
38125
38138
  return wrapped;
38126
38139
  }
38127
- 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;
38128
38141
  var init_UISlotRenderer = __esm({
38129
38142
  "components/organisms/UISlotRenderer.tsx"() {
38130
38143
  "use client";
@@ -38141,6 +38154,7 @@ var init_UISlotRenderer = __esm({
38141
38154
  init_TraitFrame();
38142
38155
  init_component_registry_generated();
38143
38156
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
38157
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
38144
38158
  SuspenseConfigContext = React116.createContext({ enabled: false });
38145
38159
  SlotContainedContext = React116.createContext(false);
38146
38160
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -16089,7 +16089,8 @@ var init_Carousel = __esm({
16089
16089
  const scrollRef = useRef(null);
16090
16090
  const autoPlayRef = useRef(null);
16091
16091
  const eventBus = useSafeEventBus3();
16092
- const totalSlides = items.length;
16092
+ const safeItems = items ?? [];
16093
+ const totalSlides = safeItems.length;
16093
16094
  const emitSlideChange = useCallback(
16094
16095
  (newIndex) => {
16095
16096
  if (slideChangeEvent) {
@@ -16200,7 +16201,7 @@ var init_Carousel = __esm({
16200
16201
  onPointerMove: swipeHandlers.onPointerMove,
16201
16202
  onPointerUp: swipeHandlers.onPointerUp,
16202
16203
  onPointerCancel: swipeHandlers.onPointerCancel,
16203
- children: items.map((item, index) => /* @__PURE__ */ jsx(
16204
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
16204
16205
  Box,
16205
16206
  {
16206
16207
  className: cn(
@@ -16269,7 +16270,7 @@ var init_Carousel = __esm({
16269
16270
  {
16270
16271
  position: "absolute",
16271
16272
  className: "bottom-3 left-0 right-0 z-10",
16272
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
16273
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
16273
16274
  const isActive = index === activeIndex;
16274
16275
  return /* @__PURE__ */ jsx(
16275
16276
  Box,
@@ -37715,7 +37716,7 @@ function UISlotComponent({
37715
37716
  );
37716
37717
  }
37717
37718
  const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37718
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37719
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
37719
37720
  return /* @__PURE__ */ jsx(
37720
37721
  Box,
37721
37722
  {
@@ -37957,6 +37958,15 @@ function SlotContentRenderer({
37957
37958
  const entityProp = content.props.entity;
37958
37959
  const entityType = typeof entityProp === "string" ? entityProp : "";
37959
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]);
37960
37970
  const schemaCtx = useEntitySchemaOptional();
37961
37971
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37962
37972
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37968,18 +37978,21 @@ function SlotContentRenderer({
37968
37978
  const { children: _childrenConfig, ...restProps } = content.props;
37969
37979
  const renderedProps = renderPatternProps(restProps, onDismiss);
37970
37980
  let finalProps;
37981
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37971
37982
  if (entityType) {
37972
37983
  finalProps = { ...renderedProps, entity: storeData };
37973
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37974
- const sample = storeData[0];
37975
- if (sample && typeof sample === "object") {
37976
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37977
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37978
- }
37979
- }
37984
+ } else if (Array.isArray(renderedProps.items)) {
37985
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37980
37986
  } else {
37981
37987
  finalProps = renderedProps;
37982
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
+ }
37983
37996
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37984
37997
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37985
37998
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -38079,7 +38092,7 @@ function UISlotRenderer({
38079
38092
  }
38080
38093
  return wrapped;
38081
38094
  }
38082
- 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;
38083
38096
  var init_UISlotRenderer = __esm({
38084
38097
  "components/organisms/UISlotRenderer.tsx"() {
38085
38098
  "use client";
@@ -38096,6 +38109,7 @@ var init_UISlotRenderer = __esm({
38096
38109
  init_TraitFrame();
38097
38110
  init_component_registry_generated();
38098
38111
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
38112
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
38099
38113
  SuspenseConfigContext = createContext({ enabled: false });
38100
38114
  SlotContainedContext = createContext(false);
38101
38115
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -15939,7 +15939,8 @@ var init_Carousel = __esm({
15939
15939
  const scrollRef = React116.useRef(null);
15940
15940
  const autoPlayRef = React116.useRef(null);
15941
15941
  const eventBus = useSafeEventBus3();
15942
- const totalSlides = items.length;
15942
+ const safeItems = items ?? [];
15943
+ const totalSlides = safeItems.length;
15943
15944
  const emitSlideChange = React116.useCallback(
15944
15945
  (newIndex) => {
15945
15946
  if (slideChangeEvent) {
@@ -16050,7 +16051,7 @@ var init_Carousel = __esm({
16050
16051
  onPointerMove: swipeHandlers.onPointerMove,
16051
16052
  onPointerUp: swipeHandlers.onPointerUp,
16052
16053
  onPointerCancel: swipeHandlers.onPointerCancel,
16053
- children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
16054
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
16054
16055
  Box,
16055
16056
  {
16056
16057
  className: cn(
@@ -16119,7 +16120,7 @@ var init_Carousel = __esm({
16119
16120
  {
16120
16121
  position: "absolute",
16121
16122
  className: "bottom-3 left-0 right-0 z-10",
16122
- children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
16123
+ children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
16123
16124
  const isActive = index === activeIndex;
16124
16125
  return /* @__PURE__ */ jsxRuntime.jsx(
16125
16126
  Box,
@@ -37333,7 +37334,7 @@ function UISlotComponent({
37333
37334
  );
37334
37335
  }
37335
37336
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37336
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37337
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
37337
37338
  return /* @__PURE__ */ jsxRuntime.jsx(
37338
37339
  Box,
37339
37340
  {
@@ -37575,6 +37576,15 @@ function SlotContentRenderer({
37575
37576
  const entityProp = content.props.entity;
37576
37577
  const entityType = typeof entityProp === "string" ? entityProp : "";
37577
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]);
37578
37588
  const schemaCtx = useEntitySchemaOptional();
37579
37589
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37580
37590
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37586,18 +37596,21 @@ function SlotContentRenderer({
37586
37596
  const { children: _childrenConfig, ...restProps } = content.props;
37587
37597
  const renderedProps = renderPatternProps(restProps, onDismiss);
37588
37598
  let finalProps;
37599
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37589
37600
  if (entityType) {
37590
37601
  finalProps = { ...renderedProps, entity: storeData };
37591
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37592
- const sample = storeData[0];
37593
- if (sample && typeof sample === "object") {
37594
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37595
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37596
- }
37597
- }
37602
+ } else if (Array.isArray(renderedProps.items)) {
37603
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37598
37604
  } else {
37599
37605
  finalProps = renderedProps;
37600
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
+ }
37601
37614
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37602
37615
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37603
37616
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37697,7 +37710,7 @@ function UISlotRenderer({
37697
37710
  }
37698
37711
  return wrapped;
37699
37712
  }
37700
- 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;
37701
37714
  var init_UISlotRenderer = __esm({
37702
37715
  "components/organisms/UISlotRenderer.tsx"() {
37703
37716
  "use client";
@@ -37714,6 +37727,7 @@ var init_UISlotRenderer = __esm({
37714
37727
  init_TraitFrame();
37715
37728
  init_component_registry_generated();
37716
37729
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37730
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37717
37731
  SuspenseConfigContext = React116.createContext({ enabled: false });
37718
37732
  SlotContainedContext = React116.createContext(false);
37719
37733
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -15894,7 +15894,8 @@ var init_Carousel = __esm({
15894
15894
  const scrollRef = useRef(null);
15895
15895
  const autoPlayRef = useRef(null);
15896
15896
  const eventBus = useSafeEventBus3();
15897
- const totalSlides = items.length;
15897
+ const safeItems = items ?? [];
15898
+ const totalSlides = safeItems.length;
15898
15899
  const emitSlideChange = useCallback(
15899
15900
  (newIndex) => {
15900
15901
  if (slideChangeEvent) {
@@ -16005,7 +16006,7 @@ var init_Carousel = __esm({
16005
16006
  onPointerMove: swipeHandlers.onPointerMove,
16006
16007
  onPointerUp: swipeHandlers.onPointerUp,
16007
16008
  onPointerCancel: swipeHandlers.onPointerCancel,
16008
- children: items.map((item, index) => /* @__PURE__ */ jsx(
16009
+ children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
16009
16010
  Box,
16010
16011
  {
16011
16012
  className: cn(
@@ -16074,7 +16075,7 @@ var init_Carousel = __esm({
16074
16075
  {
16075
16076
  position: "absolute",
16076
16077
  className: "bottom-3 left-0 right-0 z-10",
16077
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: items.map((_, index) => {
16078
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
16078
16079
  const isActive = index === activeIndex;
16079
16080
  return /* @__PURE__ */ jsx(
16080
16081
  Box,
@@ -37288,7 +37289,7 @@ function UISlotComponent({
37288
37289
  );
37289
37290
  }
37290
37291
  const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
37291
- const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
37292
+ const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
37292
37293
  return /* @__PURE__ */ jsx(
37293
37294
  Box,
37294
37295
  {
@@ -37530,6 +37531,15 @@ function SlotContentRenderer({
37530
37531
  const entityProp = content.props.entity;
37531
37532
  const entityType = typeof entityProp === "string" ? entityProp : "";
37532
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]);
37533
37543
  const schemaCtx = useEntitySchemaOptional();
37534
37544
  const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37535
37545
  const PatternComponent = getComponentForPattern(content.pattern);
@@ -37541,18 +37551,21 @@ function SlotContentRenderer({
37541
37551
  const { children: _childrenConfig, ...restProps } = content.props;
37542
37552
  const renderedProps = renderPatternProps(restProps, onDismiss);
37543
37553
  let finalProps;
37554
+ const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37544
37555
  if (entityType) {
37545
37556
  finalProps = { ...renderedProps, entity: storeData };
37546
- if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
37547
- const sample = storeData[0];
37548
- if (sample && typeof sample === "object") {
37549
- const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
37550
- finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
37551
- }
37552
- }
37557
+ } else if (Array.isArray(renderedProps.items)) {
37558
+ finalProps = { ...renderedProps, entity: renderedProps.items };
37553
37559
  } else {
37554
37560
  finalProps = renderedProps;
37555
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
+ }
37556
37569
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37557
37570
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37558
37571
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
@@ -37652,7 +37665,7 @@ function UISlotRenderer({
37652
37665
  }
37653
37666
  return wrapped;
37654
37667
  }
37655
- 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;
37656
37669
  var init_UISlotRenderer = __esm({
37657
37670
  "components/organisms/UISlotRenderer.tsx"() {
37658
37671
  "use client";
@@ -37669,6 +37682,7 @@ var init_UISlotRenderer = __esm({
37669
37682
  init_TraitFrame();
37670
37683
  init_component_registry_generated();
37671
37684
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37685
+ STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37672
37686
  SuspenseConfigContext = createContext({ enabled: false });
37673
37687
  SlotContainedContext = createContext(false);
37674
37688
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.60.4",
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",