@measured/puck 0.7.0 → 0.7.1-canary.9b15c6b

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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/dist/index.js +10 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,7 @@ Render the editor:
16
16
  ```jsx
17
17
  // Editor.jsx
18
18
  import { Puck } from "@measured/puck";
19
+ import "@measured/puck/dist/index.css";
19
20
 
20
21
  // Create puck component config
21
22
  const config = {
@@ -34,7 +35,10 @@ const config = {
34
35
  };
35
36
 
36
37
  // Describe the initial data
37
- const initialData = {};
38
+ const initialData = {
39
+ content: [],
40
+ root: {},
41
+ };
38
42
 
39
43
  // Save the data to your database
40
44
  const save = (data) => {};
package/dist/index.js CHANGED
@@ -1301,6 +1301,11 @@ function Puck({
1301
1301
  id: "puck-drop-zone",
1302
1302
  children: [
1303
1303
  data.content.map((item, i) => {
1304
+ var _a2;
1305
+ const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
1306
+ "No configuration for ",
1307
+ item.type
1308
+ ] });
1304
1309
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1305
1310
  DraggableComponent,
1306
1311
  {
@@ -1330,17 +1335,11 @@ function Puck({
1330
1335
  setData(newData);
1331
1336
  e.stopPropagation();
1332
1337
  },
1333
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { zoom: 0.75 }, children: config.components[item.type] ? config.components[item.type].render(__spreadProps(__spreadValues(__spreadValues({}, config.components[item.type].defaultProps), item.props), {
1334
- editMode: true
1335
- })) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1336
- "div",
1337
- {
1338
- style: { padding: 48, textAlign: "center" },
1339
- children: [
1340
- "No configuration for ",
1341
- item.type
1342
- ]
1343
- }
1338
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { zoom: 0.75 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1339
+ Render2,
1340
+ __spreadProps(__spreadValues(__spreadValues({}, (_a2 = config.components[item.type]) == null ? void 0 : _a2.defaultProps), item.props), {
1341
+ editMode: true
1342
+ })
1344
1343
  ) })
1345
1344
  },
1346
1345
  item.props.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.7.0",
3
+ "version": "0.7.1-canary.9b15c6b",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",