@measured/puck 0.19.4-canary.bb36dbba → 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/README.md CHANGED
@@ -1,29 +1,33 @@
1
- # Puck
1
+ <br /><br /><br />
2
2
 
3
- The visual editor for React.
3
+ <div align="center">
4
4
 
5
- <p align="left">
6
- <a aria-label="NPM version" href="https://www.npmjs.com/package/@measured/puck">
7
- <img alt="" src="https://img.shields.io/npm/v/@measured/puck.svg?style=for-the-badge&labelColor=000000">
8
- </a>
9
- <a aria-label="License" href="https://github.com/measuredco/puck/blob/main/LICENSE">
10
- <img alt="" src="https://img.shields.io/npm/l/@measured/puck.svg?style=for-the-badge&labelColor=000000">
11
- </a>
12
- <a aria-label="Join the community on Discord" href="https://discord.gg/D9e4E3MQVZ">
13
- <img alt="" src="https://img.shields.io/badge/Join%20the%20Discord-blueviolet.svg?style=for-the-badge&logo=Discord&labelColor=000000&logoWidth=20">
14
- </a>
15
- <a aria-label="Browse the awesome-puck community repo" href="https://github.com/measuredco/awesome-puck">
16
- <img alt="" src="https://img.shields.io/badge/repo-awesome--puck-fc60a8.svg?style=for-the-badge&labelColor=000000&logoWidth=20">
17
- </a>
18
- </p>
5
+ <a href="https://puckeditor.com">
6
+ <picture>
7
+ <source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/die3nptcg/image/upload/Puck_Logo_White_RGB_j2rwgg.svg" height="100px" aria-label="Puck logo">
8
+ <img src="https://res.cloudinary.com/die3nptcg/image/upload/Puck_Logo_Black_RGB_dqsjag.svg" height="100px" aria-label="Puck logo">
9
+ </picture>
10
+ </a>
19
11
 
20
- ## Demo
12
+ _The visual editor for React_
21
13
 
22
- Visit https://demo.puckeditor.com/edit to try the demo.
14
+ [Documentation](https://puckeditor.com/docs) • [Demo](https://demo.puckeditor.com/edit) [Discord](https://discord.gg/V9mDAhuxyZ) [Contributing](https://github.com/puckeditor/puck/blob/main/CONTRIBUTING.md)
23
15
 
24
- ## Documentation
16
+ ⭐️ Enjoying Puck? Please [leave a star](https://github.com/puckeditor/puck)!
25
17
 
26
- Visit https://puckeditor.com to view the full documentation.
18
+ <br />
19
+
20
+ [![GIF showing a page being created in the Puck Editor, with components being added, arranged, and customized in real time](https://github.com/user-attachments/assets/25e1ae25-ca5e-450f-afa0-01816830b731)](https://demo.puckeditor.com/edit)
21
+
22
+ </div>
23
+
24
+ ## What is Puck?
25
+
26
+ Puck is a modular, open-source visual editor for React.js. You can use Puck to build custom drag-and-drop experiences with your own application and React components.
27
+
28
+ Because Puck is just a React component, it plays well with all React.js environments, including Next.js. You own your data and there’s no vendor lock-in.
29
+
30
+ Puck is also [licensed under MIT](https://github.com/puckeditor/puck?tab=MIT-1-ov-file#readme), making it suitable for both internal systems and commercial applications.
27
31
 
28
32
  ## Quick start
29
33
 
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.bb36dbba",
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",