@measured/puck 0.19.4-canary.a884c672 → 0.19.4-canary.f09540db

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.
package/dist/index.js CHANGED
@@ -4319,9 +4319,8 @@ var ObjectField = ({
4319
4319
  readOnly,
4320
4320
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
4321
4321
  const subField = field.objectFields[subName];
4322
- const subPath = `${name}.${subName}`;
4323
- const localSubPath = `${localName || name}.${subName}`;
4324
- const subReadOnly = readOnly ? readOnly : readOnlyFields[localSubPath];
4322
+ const subPath = `${localName}.${subName}`;
4323
+ const subReadOnly = readOnly ? readOnly : readOnlyFields[subPath];
4325
4324
  const label2 = subField.label || subName;
4326
4325
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4327
4326
  NestedFieldProvider,
@@ -4420,7 +4419,7 @@ var FieldLabelInternal = ({
4420
4419
  );
4421
4420
  };
4422
4421
  function AutoFieldInternal(props) {
4423
- var _a, _b, _c, _d, _e, _f, _g, _h;
4422
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
4424
4423
  const dispatch = useAppStore((s) => s.dispatch);
4425
4424
  const overrides = useAppStore((s) => s.overrides);
4426
4425
  const readOnly = useAppStore((s) => {
@@ -4492,21 +4491,23 @@ function AutoFieldInternal(props) {
4492
4491
  if (field.type === "slot") {
4493
4492
  return null;
4494
4493
  }
4494
+ let children = null;
4495
+ let FieldComponent;
4495
4496
  if (field.type === "custom") {
4496
4497
  if (!field.render) {
4497
4498
  return null;
4498
4499
  }
4499
- const CustomField = field.render;
4500
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameWrapper(), onFocus, onBlur, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15(), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CustomField, __spreadValues({}, mergedProps)) }) });
4500
+ FieldComponent = field.render;
4501
+ } else {
4502
+ children = defaultFields[field.type](mergedProps);
4503
+ FieldComponent = render[field.type];
4501
4504
  }
4502
- const children = defaultFields[field.type](mergedProps);
4503
- const Render3 = render[field.type];
4504
4505
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4505
4506
  NestedFieldContext.Provider,
4506
4507
  {
4507
4508
  value: {
4508
4509
  readOnlyFields: nestedFieldContext.readOnlyFields || readOnly || {},
4509
- localName: nestedFieldContext.localName
4510
+ localName: (_i = nestedFieldContext.localName) != null ? _i : mergedProps.name
4510
4511
  },
4511
4512
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4512
4513
  "div",
@@ -4517,7 +4518,7 @@ function AutoFieldInternal(props) {
4517
4518
  onClick: (e) => {
4518
4519
  e.stopPropagation();
4519
4520
  },
4520
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render3, __spreadProps(__spreadValues({}, mergedProps), { children }))
4521
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FieldComponent, __spreadProps(__spreadValues({}, mergedProps), { children }))
4521
4522
  }
4522
4523
  )
4523
4524
  }
package/dist/index.mjs CHANGED
@@ -3442,9 +3442,8 @@ var ObjectField = ({
3442
3442
  readOnly,
3443
3443
  children: /* @__PURE__ */ jsx17("div", { className: getClassName14(), children: /* @__PURE__ */ jsx17("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
3444
3444
  const subField = field.objectFields[subName];
3445
- const subPath = `${name}.${subName}`;
3446
- const localSubPath = `${localName || name}.${subName}`;
3447
- const subReadOnly = readOnly ? readOnly : readOnlyFields[localSubPath];
3445
+ const subPath = `${localName}.${subName}`;
3446
+ const subReadOnly = readOnly ? readOnly : readOnlyFields[subPath];
3448
3447
  const label2 = subField.label || subName;
3449
3448
  return /* @__PURE__ */ jsx17(
3450
3449
  NestedFieldProvider,
@@ -3543,7 +3542,7 @@ var FieldLabelInternal = ({
3543
3542
  );
3544
3543
  };
3545
3544
  function AutoFieldInternal(props) {
3546
- var _a, _b, _c, _d, _e, _f, _g, _h;
3545
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3547
3546
  const dispatch = useAppStore((s) => s.dispatch);
3548
3547
  const overrides = useAppStore((s) => s.overrides);
3549
3548
  const readOnly = useAppStore((s) => {
@@ -3615,21 +3614,23 @@ function AutoFieldInternal(props) {
3615
3614
  if (field.type === "slot") {
3616
3615
  return null;
3617
3616
  }
3617
+ let children = null;
3618
+ let FieldComponent;
3618
3619
  if (field.type === "custom") {
3619
3620
  if (!field.render) {
3620
3621
  return null;
3621
3622
  }
3622
- const CustomField = field.render;
3623
- return /* @__PURE__ */ jsx18("div", { className: getClassNameWrapper(), onFocus, onBlur, children: /* @__PURE__ */ jsx18("div", { className: getClassName15(), children: /* @__PURE__ */ jsx18(CustomField, __spreadValues({}, mergedProps)) }) });
3623
+ FieldComponent = field.render;
3624
+ } else {
3625
+ children = defaultFields[field.type](mergedProps);
3626
+ FieldComponent = render[field.type];
3624
3627
  }
3625
- const children = defaultFields[field.type](mergedProps);
3626
- const Render2 = render[field.type];
3627
3628
  return /* @__PURE__ */ jsx18(
3628
3629
  NestedFieldContext.Provider,
3629
3630
  {
3630
3631
  value: {
3631
3632
  readOnlyFields: nestedFieldContext.readOnlyFields || readOnly || {},
3632
- localName: nestedFieldContext.localName
3633
+ localName: (_i = nestedFieldContext.localName) != null ? _i : mergedProps.name
3633
3634
  },
3634
3635
  children: /* @__PURE__ */ jsx18(
3635
3636
  "div",
@@ -3640,7 +3641,7 @@ function AutoFieldInternal(props) {
3640
3641
  onClick: (e) => {
3641
3642
  e.stopPropagation();
3642
3643
  },
3643
- children: /* @__PURE__ */ jsx18(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }))
3644
+ children: /* @__PURE__ */ jsx18(FieldComponent, __spreadProps(__spreadValues({}, mergedProps), { children }))
3644
3645
  }
3645
3646
  )
3646
3647
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.19.4-canary.a884c672",
3
+ "version": "0.19.4-canary.f09540db",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",