@almadar/ui 4.12.1 → 4.13.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.
@@ -6297,13 +6297,13 @@ var init_MapView = __esm({
6297
6297
  shadowSize: [41, 41]
6298
6298
  });
6299
6299
  L.Marker.prototype.options.icon = defaultIcon;
6300
- const { useEffect: useEffect66, useRef: useRef65, useCallback: useCallback115, useState: useState99 } = React111__default;
6300
+ const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback115, useState: useState99 } = React111__default;
6301
6301
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
6302
6302
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
6303
6303
  function MapUpdater({ centerLat, centerLng, zoom }) {
6304
6304
  const map = useMap();
6305
6305
  const prevRef = useRef65({ centerLat, centerLng, zoom });
6306
- useEffect66(() => {
6306
+ useEffect67(() => {
6307
6307
  const prev = prevRef.current;
6308
6308
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
6309
6309
  map.setView([centerLat, centerLng], zoom);
@@ -6314,7 +6314,7 @@ var init_MapView = __esm({
6314
6314
  }
6315
6315
  function MapClickHandler({ onMapClick }) {
6316
6316
  const map = useMap();
6317
- useEffect66(() => {
6317
+ useEffect67(() => {
6318
6318
  if (!onMapClick) return;
6319
6319
  const handler = (e) => {
6320
6320
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -17335,7 +17335,8 @@ function DataGrid({
17335
17335
  loadMoreEvent,
17336
17336
  hasMore,
17337
17337
  children,
17338
- pageSize = 0
17338
+ pageSize = 0,
17339
+ renderItem: schemaRenderItem
17339
17340
  }) {
17340
17341
  const eventBus = useEventBus();
17341
17342
  const { t } = useTranslate();
@@ -17400,6 +17401,26 @@ function DataGrid({
17400
17401
  return /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") || "No items found" }) });
17401
17402
  }
17402
17403
  const hasRenderProp = typeof children === "function";
17404
+ useEffect(() => {
17405
+ const renderItemTypeOf = typeof schemaRenderItem;
17406
+ const childrenTypeOf = typeof children;
17407
+ if (data.length > 0 && !hasRenderProp) {
17408
+ const firstRow = data[0];
17409
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
17410
+ const renderItemRaw = schemaRenderItem;
17411
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
17412
+ dataGridLog.warn("renderItem-unresolved", {
17413
+ rowCount: data.length,
17414
+ fieldsCount: fields?.length ?? 0,
17415
+ renderItemTypeOf,
17416
+ renderItemIsArray: Array.isArray(renderItemRaw),
17417
+ renderItemIsFnLambda: isFnLambda,
17418
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
17419
+ childrenTypeOf,
17420
+ sampleRowKeys: sampleKeys
17421
+ });
17422
+ }
17423
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
17403
17424
  const allIds = data.map((item, i) => item.id || String(i));
17404
17425
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
17405
17426
  const someSelected = selectedIds.size > 0;
@@ -17601,11 +17622,12 @@ function DataGrid({
17601
17622
  )
17602
17623
  ] });
17603
17624
  }
17604
- var BADGE_VARIANTS, gapStyles6;
17625
+ var dataGridLog, BADGE_VARIANTS, gapStyles6;
17605
17626
  var init_DataGrid = __esm({
17606
17627
  "components/molecules/DataGrid.tsx"() {
17607
17628
  "use client";
17608
17629
  init_cn();
17630
+ init_logger();
17609
17631
  init_getNestedValue();
17610
17632
  init_useEventBus();
17611
17633
  init_useTranslate();
@@ -17616,6 +17638,7 @@ var init_DataGrid = __esm({
17616
17638
  init_Button();
17617
17639
  init_Icon();
17618
17640
  init_InfiniteScrollSentinel();
17641
+ dataGridLog = createLogger("almadar:ui:data-grid");
17619
17642
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
17620
17643
  "default",
17621
17644
  "primary",
@@ -17707,7 +17730,8 @@ function DataList({
17707
17730
  loadMoreEvent,
17708
17731
  hasMore,
17709
17732
  children,
17710
- pageSize = 5
17733
+ pageSize = 5,
17734
+ renderItem: schemaRenderItem
17711
17735
  }) {
17712
17736
  const eventBus = useEventBus();
17713
17737
  const { t } = useTranslate();
@@ -17798,6 +17822,26 @@ function DataList({
17798
17822
  ] }, gi)) });
17799
17823
  }
17800
17824
  const hasRenderProp = typeof children === "function";
17825
+ React111__default.useEffect(() => {
17826
+ const renderItemTypeOf = typeof schemaRenderItem;
17827
+ const childrenTypeOf = typeof children;
17828
+ if (data.length > 0 && !hasRenderProp) {
17829
+ const firstRow = data[0];
17830
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
17831
+ const renderItemRaw = schemaRenderItem;
17832
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
17833
+ dataListLog.warn("renderItem-unresolved", {
17834
+ rowCount: data.length,
17835
+ fieldsCount: fields?.length ?? 0,
17836
+ renderItemTypeOf,
17837
+ renderItemIsArray: Array.isArray(renderItemRaw),
17838
+ renderItemIsFnLambda: isFnLambda,
17839
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
17840
+ childrenTypeOf,
17841
+ sampleRowKeys: sampleKeys
17842
+ });
17843
+ }
17844
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
17801
17845
  const items = data.map((item) => item);
17802
17846
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
17803
17847
  const renderItem = (itemData, index, isLast) => {
@@ -17976,10 +18020,12 @@ function DataList({
17976
18020
  }
17977
18021
  );
17978
18022
  }
18023
+ var dataListLog;
17979
18024
  var init_DataList = __esm({
17980
18025
  "components/molecules/DataList.tsx"() {
17981
18026
  "use client";
17982
18027
  init_cn();
18028
+ init_logger();
17983
18029
  init_getNestedValue();
17984
18030
  init_useEventBus();
17985
18031
  init_useTranslate();
@@ -17992,6 +18038,7 @@ var init_DataList = __esm({
17992
18038
  init_ProgressBar();
17993
18039
  init_Divider();
17994
18040
  init_InfiniteScrollSentinel();
18041
+ dataListLog = createLogger("almadar:ui:data-list");
17995
18042
  DataList.displayName = "DataList";
17996
18043
  }
17997
18044
  });
@@ -96,7 +96,7 @@ export interface DataGridProps<T extends EntityRow = EntityRow> {
96
96
  /** Max items to show before "Show More" button. Defaults to 0 (disabled). */
97
97
  pageSize?: number;
98
98
  }
99
- export declare function DataGrid<T extends EntityRow = EntityRow>({ entity, fields, itemActions, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
99
+ export declare function DataGrid<T extends EntityRow = EntityRow>({ entity, fields, itemActions, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
100
100
  export declare namespace DataGrid {
101
101
  var displayName: string;
102
102
  }
@@ -110,7 +110,7 @@ export interface DataListProps<T extends EntityRow = EntityRow> {
110
110
  /** Max items to show before "Show More" button. Defaults to 5. Set to 0 to disable. */
111
111
  pageSize?: number;
112
112
  }
113
- export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
113
+ export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
114
114
  export declare namespace DataList {
115
115
  var displayName: string;
116
116
  }
@@ -7973,13 +7973,13 @@ var init_MapView = __esm({
7973
7973
  shadowSize: [41, 41]
7974
7974
  });
7975
7975
  L.Marker.prototype.options.icon = defaultIcon;
7976
- const { useEffect: useEffect62, useRef: useRef63, useCallback: useCallback95, useState: useState87 } = React116__namespace.default;
7976
+ const { useEffect: useEffect63, useRef: useRef63, useCallback: useCallback95, useState: useState87 } = React116__namespace.default;
7977
7977
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
7978
7978
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
7979
7979
  function MapUpdater({ centerLat, centerLng, zoom }) {
7980
7980
  const map = useMap();
7981
7981
  const prevRef = useRef63({ centerLat, centerLng, zoom });
7982
- useEffect62(() => {
7982
+ useEffect63(() => {
7983
7983
  const prev = prevRef.current;
7984
7984
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
7985
7985
  map.setView([centerLat, centerLng], zoom);
@@ -7990,7 +7990,7 @@ var init_MapView = __esm({
7990
7990
  }
7991
7991
  function MapClickHandler({ onMapClick }) {
7992
7992
  const map = useMap();
7993
- useEffect62(() => {
7993
+ useEffect63(() => {
7994
7994
  if (!onMapClick) return;
7995
7995
  const handler = (e) => {
7996
7996
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -18696,7 +18696,8 @@ function DataGrid({
18696
18696
  loadMoreEvent,
18697
18697
  hasMore,
18698
18698
  children,
18699
- pageSize = 0
18699
+ pageSize = 0,
18700
+ renderItem: schemaRenderItem
18700
18701
  }) {
18701
18702
  const eventBus = useEventBus();
18702
18703
  const { t } = useTranslate();
@@ -18761,6 +18762,26 @@ function DataGrid({
18761
18762
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") || "No items found" }) });
18762
18763
  }
18763
18764
  const hasRenderProp = typeof children === "function";
18765
+ React116.useEffect(() => {
18766
+ const renderItemTypeOf = typeof schemaRenderItem;
18767
+ const childrenTypeOf = typeof children;
18768
+ if (data.length > 0 && !hasRenderProp) {
18769
+ const firstRow = data[0];
18770
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
18771
+ const renderItemRaw = schemaRenderItem;
18772
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
18773
+ dataGridLog.warn("renderItem-unresolved", {
18774
+ rowCount: data.length,
18775
+ fieldsCount: fields?.length ?? 0,
18776
+ renderItemTypeOf,
18777
+ renderItemIsArray: Array.isArray(renderItemRaw),
18778
+ renderItemIsFnLambda: isFnLambda,
18779
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
18780
+ childrenTypeOf,
18781
+ sampleRowKeys: sampleKeys
18782
+ });
18783
+ }
18784
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
18764
18785
  const allIds = data.map((item, i) => item.id || String(i));
18765
18786
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
18766
18787
  const someSelected = selectedIds.size > 0;
@@ -18962,11 +18983,12 @@ function DataGrid({
18962
18983
  )
18963
18984
  ] });
18964
18985
  }
18965
- var BADGE_VARIANTS, gapStyles6;
18986
+ var dataGridLog, BADGE_VARIANTS, gapStyles6;
18966
18987
  var init_DataGrid = __esm({
18967
18988
  "components/molecules/DataGrid.tsx"() {
18968
18989
  "use client";
18969
18990
  init_cn();
18991
+ init_logger();
18970
18992
  init_getNestedValue();
18971
18993
  init_useEventBus();
18972
18994
  init_useTranslate();
@@ -18977,6 +18999,7 @@ var init_DataGrid = __esm({
18977
18999
  init_Button();
18978
19000
  init_Icon();
18979
19001
  init_InfiniteScrollSentinel();
19002
+ dataGridLog = createLogger("almadar:ui:data-grid");
18980
19003
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
18981
19004
  "default",
18982
19005
  "primary",
@@ -19068,7 +19091,8 @@ function DataList({
19068
19091
  loadMoreEvent,
19069
19092
  hasMore,
19070
19093
  children,
19071
- pageSize = 5
19094
+ pageSize = 5,
19095
+ renderItem: schemaRenderItem
19072
19096
  }) {
19073
19097
  const eventBus = useEventBus();
19074
19098
  const { t } = useTranslate();
@@ -19159,6 +19183,26 @@ function DataList({
19159
19183
  ] }, gi)) });
19160
19184
  }
19161
19185
  const hasRenderProp = typeof children === "function";
19186
+ React116__namespace.default.useEffect(() => {
19187
+ const renderItemTypeOf = typeof schemaRenderItem;
19188
+ const childrenTypeOf = typeof children;
19189
+ if (data.length > 0 && !hasRenderProp) {
19190
+ const firstRow = data[0];
19191
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
19192
+ const renderItemRaw = schemaRenderItem;
19193
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
19194
+ dataListLog.warn("renderItem-unresolved", {
19195
+ rowCount: data.length,
19196
+ fieldsCount: fields?.length ?? 0,
19197
+ renderItemTypeOf,
19198
+ renderItemIsArray: Array.isArray(renderItemRaw),
19199
+ renderItemIsFnLambda: isFnLambda,
19200
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
19201
+ childrenTypeOf,
19202
+ sampleRowKeys: sampleKeys
19203
+ });
19204
+ }
19205
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
19162
19206
  const items = data.map((item) => item);
19163
19207
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
19164
19208
  const renderItem = (itemData, index, isLast) => {
@@ -19337,10 +19381,12 @@ function DataList({
19337
19381
  }
19338
19382
  );
19339
19383
  }
19384
+ var dataListLog;
19340
19385
  var init_DataList = __esm({
19341
19386
  "components/molecules/DataList.tsx"() {
19342
19387
  "use client";
19343
19388
  init_cn();
19389
+ init_logger();
19344
19390
  init_getNestedValue();
19345
19391
  init_useEventBus();
19346
19392
  init_useTranslate();
@@ -19353,6 +19399,7 @@ var init_DataList = __esm({
19353
19399
  init_ProgressBar();
19354
19400
  init_Divider();
19355
19401
  init_InfiniteScrollSentinel();
19402
+ dataListLog = createLogger("almadar:ui:data-list");
19356
19403
  DataList.displayName = "DataList";
19357
19404
  }
19358
19405
  });
@@ -7928,13 +7928,13 @@ var init_MapView = __esm({
7928
7928
  shadowSize: [41, 41]
7929
7929
  });
7930
7930
  L.Marker.prototype.options.icon = defaultIcon;
7931
- const { useEffect: useEffect62, useRef: useRef63, useCallback: useCallback95, useState: useState87 } = React116__default;
7931
+ const { useEffect: useEffect63, useRef: useRef63, useCallback: useCallback95, useState: useState87 } = React116__default;
7932
7932
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
7933
7933
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
7934
7934
  function MapUpdater({ centerLat, centerLng, zoom }) {
7935
7935
  const map = useMap();
7936
7936
  const prevRef = useRef63({ centerLat, centerLng, zoom });
7937
- useEffect62(() => {
7937
+ useEffect63(() => {
7938
7938
  const prev = prevRef.current;
7939
7939
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
7940
7940
  map.setView([centerLat, centerLng], zoom);
@@ -7945,7 +7945,7 @@ var init_MapView = __esm({
7945
7945
  }
7946
7946
  function MapClickHandler({ onMapClick }) {
7947
7947
  const map = useMap();
7948
- useEffect62(() => {
7948
+ useEffect63(() => {
7949
7949
  if (!onMapClick) return;
7950
7950
  const handler = (e) => {
7951
7951
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -18651,7 +18651,8 @@ function DataGrid({
18651
18651
  loadMoreEvent,
18652
18652
  hasMore,
18653
18653
  children,
18654
- pageSize = 0
18654
+ pageSize = 0,
18655
+ renderItem: schemaRenderItem
18655
18656
  }) {
18656
18657
  const eventBus = useEventBus();
18657
18658
  const { t } = useTranslate();
@@ -18716,6 +18717,26 @@ function DataGrid({
18716
18717
  return /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") || "No items found" }) });
18717
18718
  }
18718
18719
  const hasRenderProp = typeof children === "function";
18720
+ useEffect(() => {
18721
+ const renderItemTypeOf = typeof schemaRenderItem;
18722
+ const childrenTypeOf = typeof children;
18723
+ if (data.length > 0 && !hasRenderProp) {
18724
+ const firstRow = data[0];
18725
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
18726
+ const renderItemRaw = schemaRenderItem;
18727
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
18728
+ dataGridLog.warn("renderItem-unresolved", {
18729
+ rowCount: data.length,
18730
+ fieldsCount: fields?.length ?? 0,
18731
+ renderItemTypeOf,
18732
+ renderItemIsArray: Array.isArray(renderItemRaw),
18733
+ renderItemIsFnLambda: isFnLambda,
18734
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
18735
+ childrenTypeOf,
18736
+ sampleRowKeys: sampleKeys
18737
+ });
18738
+ }
18739
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
18719
18740
  const allIds = data.map((item, i) => item.id || String(i));
18720
18741
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
18721
18742
  const someSelected = selectedIds.size > 0;
@@ -18917,11 +18938,12 @@ function DataGrid({
18917
18938
  )
18918
18939
  ] });
18919
18940
  }
18920
- var BADGE_VARIANTS, gapStyles6;
18941
+ var dataGridLog, BADGE_VARIANTS, gapStyles6;
18921
18942
  var init_DataGrid = __esm({
18922
18943
  "components/molecules/DataGrid.tsx"() {
18923
18944
  "use client";
18924
18945
  init_cn();
18946
+ init_logger();
18925
18947
  init_getNestedValue();
18926
18948
  init_useEventBus();
18927
18949
  init_useTranslate();
@@ -18932,6 +18954,7 @@ var init_DataGrid = __esm({
18932
18954
  init_Button();
18933
18955
  init_Icon();
18934
18956
  init_InfiniteScrollSentinel();
18957
+ dataGridLog = createLogger("almadar:ui:data-grid");
18935
18958
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
18936
18959
  "default",
18937
18960
  "primary",
@@ -19023,7 +19046,8 @@ function DataList({
19023
19046
  loadMoreEvent,
19024
19047
  hasMore,
19025
19048
  children,
19026
- pageSize = 5
19049
+ pageSize = 5,
19050
+ renderItem: schemaRenderItem
19027
19051
  }) {
19028
19052
  const eventBus = useEventBus();
19029
19053
  const { t } = useTranslate();
@@ -19114,6 +19138,26 @@ function DataList({
19114
19138
  ] }, gi)) });
19115
19139
  }
19116
19140
  const hasRenderProp = typeof children === "function";
19141
+ React116__default.useEffect(() => {
19142
+ const renderItemTypeOf = typeof schemaRenderItem;
19143
+ const childrenTypeOf = typeof children;
19144
+ if (data.length > 0 && !hasRenderProp) {
19145
+ const firstRow = data[0];
19146
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
19147
+ const renderItemRaw = schemaRenderItem;
19148
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
19149
+ dataListLog.warn("renderItem-unresolved", {
19150
+ rowCount: data.length,
19151
+ fieldsCount: fields?.length ?? 0,
19152
+ renderItemTypeOf,
19153
+ renderItemIsArray: Array.isArray(renderItemRaw),
19154
+ renderItemIsFnLambda: isFnLambda,
19155
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
19156
+ childrenTypeOf,
19157
+ sampleRowKeys: sampleKeys
19158
+ });
19159
+ }
19160
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
19117
19161
  const items = data.map((item) => item);
19118
19162
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
19119
19163
  const renderItem = (itemData, index, isLast) => {
@@ -19292,10 +19336,12 @@ function DataList({
19292
19336
  }
19293
19337
  );
19294
19338
  }
19339
+ var dataListLog;
19295
19340
  var init_DataList = __esm({
19296
19341
  "components/molecules/DataList.tsx"() {
19297
19342
  "use client";
19298
19343
  init_cn();
19344
+ init_logger();
19299
19345
  init_getNestedValue();
19300
19346
  init_useEventBus();
19301
19347
  init_useTranslate();
@@ -19308,6 +19354,7 @@ var init_DataList = __esm({
19308
19354
  init_ProgressBar();
19309
19355
  init_Divider();
19310
19356
  init_InfiniteScrollSentinel();
19357
+ dataListLog = createLogger("almadar:ui:data-list");
19311
19358
  DataList.displayName = "DataList";
19312
19359
  }
19313
19360
  });
@@ -8230,13 +8230,13 @@ var init_MapView = __esm({
8230
8230
  shadowSize: [41, 41]
8231
8231
  });
8232
8232
  L.Marker.prototype.options.icon = defaultIcon;
8233
- const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback110, useState: useState103 } = React115__namespace.default;
8233
+ const { useEffect: useEffect70, useRef: useRef65, useCallback: useCallback110, useState: useState103 } = React115__namespace.default;
8234
8234
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
8235
8235
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
8236
8236
  function MapUpdater({ centerLat, centerLng, zoom }) {
8237
8237
  const map = useMap();
8238
8238
  const prevRef = useRef65({ centerLat, centerLng, zoom });
8239
- useEffect69(() => {
8239
+ useEffect70(() => {
8240
8240
  const prev = prevRef.current;
8241
8241
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
8242
8242
  map.setView([centerLat, centerLng], zoom);
@@ -8247,7 +8247,7 @@ var init_MapView = __esm({
8247
8247
  }
8248
8248
  function MapClickHandler({ onMapClick }) {
8249
8249
  const map = useMap();
8250
- useEffect69(() => {
8250
+ useEffect70(() => {
8251
8251
  if (!onMapClick) return;
8252
8252
  const handler = (e) => {
8253
8253
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -18602,7 +18602,8 @@ function DataGrid({
18602
18602
  loadMoreEvent,
18603
18603
  hasMore,
18604
18604
  children,
18605
- pageSize = 0
18605
+ pageSize = 0,
18606
+ renderItem: schemaRenderItem
18606
18607
  }) {
18607
18608
  const eventBus = useEventBus();
18608
18609
  const { t } = useTranslate();
@@ -18667,6 +18668,26 @@ function DataGrid({
18667
18668
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") || "No items found" }) });
18668
18669
  }
18669
18670
  const hasRenderProp = typeof children === "function";
18671
+ React115.useEffect(() => {
18672
+ const renderItemTypeOf = typeof schemaRenderItem;
18673
+ const childrenTypeOf = typeof children;
18674
+ if (data.length > 0 && !hasRenderProp) {
18675
+ const firstRow = data[0];
18676
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
18677
+ const renderItemRaw = schemaRenderItem;
18678
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
18679
+ dataGridLog.warn("renderItem-unresolved", {
18680
+ rowCount: data.length,
18681
+ fieldsCount: fields?.length ?? 0,
18682
+ renderItemTypeOf,
18683
+ renderItemIsArray: Array.isArray(renderItemRaw),
18684
+ renderItemIsFnLambda: isFnLambda,
18685
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
18686
+ childrenTypeOf,
18687
+ sampleRowKeys: sampleKeys
18688
+ });
18689
+ }
18690
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
18670
18691
  const allIds = data.map((item, i) => item.id || String(i));
18671
18692
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
18672
18693
  const someSelected = selectedIds.size > 0;
@@ -18868,11 +18889,12 @@ function DataGrid({
18868
18889
  )
18869
18890
  ] });
18870
18891
  }
18871
- var BADGE_VARIANTS, gapStyles6;
18892
+ var dataGridLog, BADGE_VARIANTS, gapStyles6;
18872
18893
  var init_DataGrid = __esm({
18873
18894
  "components/molecules/DataGrid.tsx"() {
18874
18895
  "use client";
18875
18896
  init_cn();
18897
+ init_logger();
18876
18898
  init_getNestedValue();
18877
18899
  init_useEventBus();
18878
18900
  init_useTranslate();
@@ -18883,6 +18905,7 @@ var init_DataGrid = __esm({
18883
18905
  init_Button();
18884
18906
  init_Icon();
18885
18907
  init_InfiniteScrollSentinel();
18908
+ dataGridLog = createLogger("almadar:ui:data-grid");
18886
18909
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
18887
18910
  "default",
18888
18911
  "primary",
@@ -18974,7 +18997,8 @@ function DataList({
18974
18997
  loadMoreEvent,
18975
18998
  hasMore,
18976
18999
  children,
18977
- pageSize = 5
19000
+ pageSize = 5,
19001
+ renderItem: schemaRenderItem
18978
19002
  }) {
18979
19003
  const eventBus = useEventBus();
18980
19004
  const { t } = useTranslate();
@@ -19065,6 +19089,26 @@ function DataList({
19065
19089
  ] }, gi)) });
19066
19090
  }
19067
19091
  const hasRenderProp = typeof children === "function";
19092
+ React115__namespace.default.useEffect(() => {
19093
+ const renderItemTypeOf = typeof schemaRenderItem;
19094
+ const childrenTypeOf = typeof children;
19095
+ if (data.length > 0 && !hasRenderProp) {
19096
+ const firstRow = data[0];
19097
+ const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
19098
+ const renderItemRaw = schemaRenderItem;
19099
+ const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
19100
+ dataListLog.warn("renderItem-unresolved", {
19101
+ rowCount: data.length,
19102
+ fieldsCount: fields?.length ?? 0,
19103
+ renderItemTypeOf,
19104
+ renderItemIsArray: Array.isArray(renderItemRaw),
19105
+ renderItemIsFnLambda: isFnLambda,
19106
+ renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
19107
+ childrenTypeOf,
19108
+ sampleRowKeys: sampleKeys
19109
+ });
19110
+ }
19111
+ }, [data, hasRenderProp, schemaRenderItem, children, fields]);
19068
19112
  const items = data.map((item) => item);
19069
19113
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
19070
19114
  const renderItem = (itemData, index, isLast) => {
@@ -19243,10 +19287,12 @@ function DataList({
19243
19287
  }
19244
19288
  );
19245
19289
  }
19290
+ var dataListLog;
19246
19291
  var init_DataList = __esm({
19247
19292
  "components/molecules/DataList.tsx"() {
19248
19293
  "use client";
19249
19294
  init_cn();
19295
+ init_logger();
19250
19296
  init_getNestedValue();
19251
19297
  init_useEventBus();
19252
19298
  init_useTranslate();
@@ -19259,6 +19305,7 @@ var init_DataList = __esm({
19259
19305
  init_ProgressBar();
19260
19306
  init_Divider();
19261
19307
  init_InfiniteScrollSentinel();
19308
+ dataListLog = createLogger("almadar:ui:data-list");
19262
19309
  DataList.displayName = "DataList";
19263
19310
  }
19264
19311
  });
@@ -39316,18 +39363,49 @@ function normalizeChild(child) {
39316
39363
  props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
39317
39364
  };
39318
39365
  }
39319
- function SlotBridge() {
39366
+ function SlotBridge({ embeddedTraits }) {
39320
39367
  const slots = useSlots();
39321
- const { render, clear } = context.useUISlots();
39368
+ const { render, clear, updateTraitContent } = context.useUISlots();
39322
39369
  React115.useEffect(() => {
39323
39370
  slotLog.debug("SlotBridge:effect-fired", {
39324
39371
  slotCount: Object.keys(slots).length,
39325
39372
  slots: Object.keys(slots)
39326
39373
  });
39327
39374
  for (const [slotName, slotState] of Object.entries(slots)) {
39328
- const entries = slotEntriesInOrder(slotState);
39375
+ const allEntries = slotEntriesInOrder(slotState);
39376
+ const entries = [];
39377
+ for (const e of allEntries) {
39378
+ const traitName = e.entry.source?.trait;
39379
+ if (traitName && embeddedTraits?.has(traitName)) {
39380
+ const last = e.entry.patterns[e.entry.patterns.length - 1];
39381
+ if (last?.pattern && typeof last.pattern === "object") {
39382
+ const record = last.pattern;
39383
+ const { type: patternType, children: nested, ...inlineProps } = record;
39384
+ const normalizedNested = Array.isArray(nested) ? nested.map((c) => normalizeChild(c)) : nested;
39385
+ updateTraitContent(traitName, {
39386
+ pattern: patternType,
39387
+ props: {
39388
+ ...inlineProps,
39389
+ ...last.props,
39390
+ ...normalizedNested !== void 0 ? { children: normalizedNested } : {}
39391
+ },
39392
+ priority: 0,
39393
+ animation: "fade"
39394
+ });
39395
+ }
39396
+ continue;
39397
+ }
39398
+ entries.push(e);
39399
+ }
39329
39400
  if (entries.length === 0) {
39330
- clear(slotName);
39401
+ if (allEntries.length === 0) {
39402
+ clear(slotName);
39403
+ } else {
39404
+ slotLog.debug("SlotBridge:embed-only-skip", {
39405
+ slot: slotName,
39406
+ embeddedCount: allEntries.length
39407
+ });
39408
+ }
39331
39409
  continue;
39332
39410
  }
39333
39411
  const children = entries.map(({ entry }) => entry.patterns[entry.patterns.length - 1]).filter((p2) => Boolean(p2)).map((entry) => {
@@ -39374,7 +39452,7 @@ function SlotBridge() {
39374
39452
  });
39375
39453
  }
39376
39454
  }
39377
- }, [slots, render, clear]);
39455
+ }, [slots, render, clear, updateTraitContent, embeddedTraits]);
39378
39456
  return null;
39379
39457
  }
39380
39458
  function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
@@ -39609,7 +39687,7 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
39609
39687
  persistence
39610
39688
  }
39611
39689
  ),
39612
- /* @__PURE__ */ jsxRuntime.jsx(SlotBridge, {}),
39690
+ /* @__PURE__ */ jsxRuntime.jsx(SlotBridge, { embeddedTraits }),
39613
39691
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-full p-4", children: /* @__PURE__ */ jsxRuntime.jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
39614
39692
  ]
39615
39693
  }