@almadar/ui 2.30.0 → 2.32.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.
@@ -35045,7 +35045,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
35045
35045
  id: childId,
35046
35046
  pattern: child.type,
35047
35047
  props: child.props ?? {},
35048
- priority: 0
35048
+ priority: 0,
35049
+ nodeId: child._id
35049
35050
  };
35050
35051
  return /* @__PURE__ */ jsxRuntime.jsx(
35051
35052
  SlotContentRenderer,
@@ -35095,13 +35096,27 @@ function SlotContentRenderer({
35095
35096
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
35096
35097
  const { children: _childrenConfig, ...restProps } = content.props;
35097
35098
  const renderedProps = renderPatternProps(restProps, onDismiss);
35098
- const finalProps = entityType ? { ...renderedProps, entity: storeData } : renderedProps;
35099
+ let finalProps;
35100
+ if (entityType) {
35101
+ finalProps = { ...renderedProps, entity: storeData };
35102
+ if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
35103
+ const sample = storeData[0];
35104
+ if (sample && typeof sample === "object") {
35105
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
35106
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
35107
+ }
35108
+ }
35109
+ } else {
35110
+ finalProps = renderedProps;
35111
+ }
35099
35112
  return /* @__PURE__ */ jsxRuntime.jsx(
35100
35113
  Box,
35101
35114
  {
35102
35115
  className: "slot-content",
35103
35116
  "data-pattern": content.pattern,
35104
35117
  "data-id": content.id,
35118
+ "data-node-id": content.nodeId,
35119
+ "data-source-trait": content.sourceTrait,
35105
35120
  children: /* @__PURE__ */ jsxRuntime.jsx(PatternComponent, { ...finalProps, children: renderedChildren })
35106
35121
  }
35107
35122
  );
@@ -35112,6 +35127,8 @@ function SlotContentRenderer({
35112
35127
  className: "slot-content",
35113
35128
  "data-pattern": content.pattern,
35114
35129
  "data-id": content.id,
35130
+ "data-node-id": content.nodeId,
35131
+ "data-source-trait": content.sourceTrait,
35115
35132
  children: content.props.children ?? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
35116
35133
  "Unknown pattern: ",
35117
35134
  content.pattern,
@@ -35015,7 +35015,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
35015
35015
  id: childId,
35016
35016
  pattern: child.type,
35017
35017
  props: child.props ?? {},
35018
- priority: 0
35018
+ priority: 0,
35019
+ nodeId: child._id
35019
35020
  };
35020
35021
  return /* @__PURE__ */ jsx(
35021
35022
  SlotContentRenderer,
@@ -35065,13 +35066,27 @@ function SlotContentRenderer({
35065
35066
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
35066
35067
  const { children: _childrenConfig, ...restProps } = content.props;
35067
35068
  const renderedProps = renderPatternProps(restProps, onDismiss);
35068
- const finalProps = entityType ? { ...renderedProps, entity: storeData } : renderedProps;
35069
+ let finalProps;
35070
+ if (entityType) {
35071
+ finalProps = { ...renderedProps, entity: storeData };
35072
+ if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
35073
+ const sample = storeData[0];
35074
+ if (sample && typeof sample === "object") {
35075
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
35076
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
35077
+ }
35078
+ }
35079
+ } else {
35080
+ finalProps = renderedProps;
35081
+ }
35069
35082
  return /* @__PURE__ */ jsx(
35070
35083
  Box,
35071
35084
  {
35072
35085
  className: "slot-content",
35073
35086
  "data-pattern": content.pattern,
35074
35087
  "data-id": content.id,
35088
+ "data-node-id": content.nodeId,
35089
+ "data-source-trait": content.sourceTrait,
35075
35090
  children: /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren })
35076
35091
  }
35077
35092
  );
@@ -35082,6 +35097,8 @@ function SlotContentRenderer({
35082
35097
  className: "slot-content",
35083
35098
  "data-pattern": content.pattern,
35084
35099
  "data-id": content.id,
35100
+ "data-node-id": content.nodeId,
35101
+ "data-source-trait": content.sourceTrait,
35085
35102
  children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
35086
35103
  "Unknown pattern: ",
35087
35104
  content.pattern,
@@ -26,6 +26,8 @@ export interface SlotContent {
26
26
  onDismiss?: () => void;
27
27
  /** Source trait that rendered this content */
28
28
  sourceTrait?: string;
29
+ /** Stable node ID from the schema pattern tree (for edit mode overlay targeting) */
30
+ nodeId?: string;
29
31
  }
30
32
  /**
31
33
  * Configuration for render_ui effect
@@ -32308,7 +32308,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
32308
32308
  id: childId,
32309
32309
  pattern: child.type,
32310
32310
  props: child.props ?? {},
32311
- priority: 0
32311
+ priority: 0,
32312
+ nodeId: child._id
32312
32313
  };
32313
32314
  return /* @__PURE__ */ jsxRuntime.jsx(
32314
32315
  SlotContentRenderer,
@@ -32358,13 +32359,27 @@ function SlotContentRenderer({
32358
32359
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
32359
32360
  const { children: _childrenConfig, ...restProps } = content.props;
32360
32361
  const renderedProps = renderPatternProps(restProps, onDismiss);
32361
- const finalProps = entityType ? { ...renderedProps, entity: storeData } : renderedProps;
32362
+ let finalProps;
32363
+ if (entityType) {
32364
+ finalProps = { ...renderedProps, entity: storeData };
32365
+ if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
32366
+ const sample = storeData[0];
32367
+ if (sample && typeof sample === "object") {
32368
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
32369
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
32370
+ }
32371
+ }
32372
+ } else {
32373
+ finalProps = renderedProps;
32374
+ }
32362
32375
  return /* @__PURE__ */ jsxRuntime.jsx(
32363
32376
  Box,
32364
32377
  {
32365
32378
  className: "slot-content",
32366
32379
  "data-pattern": content.pattern,
32367
32380
  "data-id": content.id,
32381
+ "data-node-id": content.nodeId,
32382
+ "data-source-trait": content.sourceTrait,
32368
32383
  children: /* @__PURE__ */ jsxRuntime.jsx(PatternComponent, { ...finalProps, children: renderedChildren })
32369
32384
  }
32370
32385
  );
@@ -32375,6 +32390,8 @@ function SlotContentRenderer({
32375
32390
  className: "slot-content",
32376
32391
  "data-pattern": content.pattern,
32377
32392
  "data-id": content.id,
32393
+ "data-node-id": content.nodeId,
32394
+ "data-source-trait": content.sourceTrait,
32378
32395
  children: content.props.children ?? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
32379
32396
  "Unknown pattern: ",
32380
32397
  content.pattern,
@@ -32278,7 +32278,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
32278
32278
  id: childId,
32279
32279
  pattern: child.type,
32280
32280
  props: child.props ?? {},
32281
- priority: 0
32281
+ priority: 0,
32282
+ nodeId: child._id
32282
32283
  };
32283
32284
  return /* @__PURE__ */ jsx(
32284
32285
  SlotContentRenderer,
@@ -32328,13 +32329,27 @@ function SlotContentRenderer({
32328
32329
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
32329
32330
  const { children: _childrenConfig, ...restProps } = content.props;
32330
32331
  const renderedProps = renderPatternProps(restProps, onDismiss);
32331
- const finalProps = entityType ? { ...renderedProps, entity: storeData } : renderedProps;
32332
+ let finalProps;
32333
+ if (entityType) {
32334
+ finalProps = { ...renderedProps, entity: storeData };
32335
+ if (!finalProps.fields && !finalProps.columns && storeData.length > 0) {
32336
+ const sample = storeData[0];
32337
+ if (sample && typeof sample === "object") {
32338
+ const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
32339
+ finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
32340
+ }
32341
+ }
32342
+ } else {
32343
+ finalProps = renderedProps;
32344
+ }
32332
32345
  return /* @__PURE__ */ jsx(
32333
32346
  Box,
32334
32347
  {
32335
32348
  className: "slot-content",
32336
32349
  "data-pattern": content.pattern,
32337
32350
  "data-id": content.id,
32351
+ "data-node-id": content.nodeId,
32352
+ "data-source-trait": content.sourceTrait,
32338
32353
  children: /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren })
32339
32354
  }
32340
32355
  );
@@ -32345,6 +32360,8 @@ function SlotContentRenderer({
32345
32360
  className: "slot-content",
32346
32361
  "data-pattern": content.pattern,
32347
32362
  "data-id": content.id,
32363
+ "data-node-id": content.nodeId,
32364
+ "data-source-trait": content.sourceTrait,
32348
32365
  children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
32349
32366
  "Unknown pattern: ",
32350
32367
  content.pattern,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.30.0",
3
+ "version": "2.32.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",