@measured/puck 0.8.0-canary.06b145b → 0.8.0-canary.6e95652

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.d.ts CHANGED
@@ -7,9 +7,6 @@ type Adaptor<AdaptorParams = {}> = {
7
7
  name: string;
8
8
  fetchList: (adaptorParams?: AdaptorParams) => Promise<Record<string, any>[] | null>;
9
9
  };
10
- type WithId<T> = T & {
11
- id: string;
12
- };
13
10
  type Field<Props extends {
14
11
  [key: string]: any;
15
12
  } = {
@@ -20,7 +17,7 @@ type Field<Props extends {
20
17
  adaptor?: Adaptor;
21
18
  adaptorParams?: object;
22
19
  arrayFields?: {
23
- [SubPropName in keyof Props]: Field<Props[SubPropName][0]>;
20
+ [SubPropName in keyof Props]: Field<Props[SubPropName]>;
24
21
  };
25
22
  getItemSummary?: (item: Props, index?: number) => string;
26
23
  defaultItemProps?: Props;
@@ -55,7 +52,7 @@ type Content<Props extends {
55
52
  [key: string]: any;
56
53
  }> = MappedItem<Props>[];
57
54
  type ComponentConfig<ComponentProps extends DefaultComponentProps = DefaultComponentProps, DefaultProps = ComponentProps> = {
58
- render: (props: WithId<ComponentProps>) => ReactElement;
55
+ render: (props: ComponentProps) => ReactElement;
59
56
  defaultProps?: DefaultProps;
60
57
  fields?: Fields<ComponentProps>;
61
58
  };
@@ -79,9 +76,11 @@ type MappedItem<Props extends {
79
76
  [key: string]: any;
80
77
  }> = {
81
78
  type: keyof Props;
82
- props: WithId<{
79
+ props: {
83
80
  [key: string]: any;
84
- }>;
81
+ } & {
82
+ id: string;
83
+ };
85
84
  };
86
85
  type Data<Props extends {
87
86
  [key: string]: any;
package/dist/index.js CHANGED
@@ -2330,7 +2330,7 @@ init_react_import();
2330
2330
  var import_jsx_runtime14 = require("react/jsx-runtime");
2331
2331
  function Render({ config, data }) {
2332
2332
  if (config.root) {
2333
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(config.root.render, __spreadProps(__spreadValues({}, data.root), { editMode: false, id: "puck-root", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZone, { zone: rootDroppableId }) })) });
2333
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(config.root.render, __spreadProps(__spreadValues({}, data.root), { editMode: false, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZone, { zone: rootDroppableId }) })) });
2334
2334
  }
2335
2335
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropZone, { zone: rootDroppableId }) });
2336
2336
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.8.0-canary.06b145b",
3
+ "version": "0.8.0-canary.6e95652",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",