@measured/puck 0.19.0-canary.896a6279 → 0.19.0-canary.8d459e4e

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/rsc.mjs CHANGED
@@ -1,112 +1,12 @@
1
1
  import {
2
- SlotRenderPure,
3
- __spreadProps,
4
- __spreadValues,
2
+ Render,
5
3
  init_react_import,
6
4
  resolveAllData,
7
- rootAreaId,
8
- rootDroppableId,
9
- rootZone,
10
- setupZone,
11
- transformProps,
12
- useSlots
13
- } from "./chunk-LT6HN46T.mjs";
5
+ transformProps
6
+ } from "./chunk-D6ENWNOG.mjs";
14
7
 
15
8
  // rsc.tsx
16
9
  init_react_import();
17
-
18
- // components/ServerRender/index.tsx
19
- init_react_import();
20
- import { Fragment, jsx } from "react/jsx-runtime";
21
- function DropZoneRender({
22
- zone,
23
- data,
24
- areaId = "root",
25
- config,
26
- metadata = {}
27
- }) {
28
- let zoneCompound = rootDroppableId;
29
- let content = (data == null ? void 0 : data.content) || [];
30
- if (!data || !config) {
31
- return null;
32
- }
33
- if (areaId !== rootAreaId && zone !== rootZone) {
34
- zoneCompound = `${areaId}:${zone}`;
35
- content = setupZone(data, zoneCompound).zones[zoneCompound];
36
- }
37
- return /* @__PURE__ */ jsx(Fragment, { children: content.map((item) => {
38
- const Component = config.components[item.type];
39
- const props = __spreadProps(__spreadValues({}, item.props), {
40
- puck: {
41
- renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ jsx(
42
- DropZoneRender,
43
- {
44
- zone: zone2,
45
- data,
46
- areaId: item.props.id,
47
- config,
48
- metadata
49
- }
50
- ),
51
- metadata
52
- }
53
- });
54
- const propsWithSlots = useSlots(config.root, props, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
55
- if (Component) {
56
- return /* @__PURE__ */ jsx(Component.render, __spreadValues({}, propsWithSlots), item.props.id);
57
- }
58
- return null;
59
- }) });
60
- }
61
- function Render({
62
- config,
63
- data,
64
- metadata = {}
65
- }) {
66
- var _a;
67
- const rootProps = data.root.props || data.root;
68
- const title = rootProps.title || "";
69
- const props = __spreadProps(__spreadValues({}, rootProps), {
70
- puck: {
71
- renderDropZone: ({ zone }) => /* @__PURE__ */ jsx(
72
- DropZoneRender,
73
- {
74
- zone,
75
- data,
76
- config,
77
- metadata
78
- }
79
- ),
80
- isEditing: false,
81
- dragRef: null,
82
- metadata
83
- },
84
- title,
85
- editMode: false,
86
- id: "puck-root"
87
- });
88
- const propsWithSlots = useSlots(config.root, props, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
89
- if ((_a = config.root) == null ? void 0 : _a.render) {
90
- return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues({}, propsWithSlots), { children: /* @__PURE__ */ jsx(
91
- DropZoneRender,
92
- {
93
- config,
94
- data,
95
- zone: rootZone,
96
- metadata
97
- }
98
- ) }));
99
- }
100
- return /* @__PURE__ */ jsx(
101
- DropZoneRender,
102
- {
103
- config,
104
- data,
105
- zone: rootZone,
106
- metadata
107
- }
108
- );
109
- }
110
10
  export {
111
11
  Render,
112
12
  resolveAllData,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.19.0-canary.896a6279",
4
- "author": "Measured Corporation Ltd <hello@measured.co>",
3
+ "version": "0.19.0-canary.8d459e4e",
4
+ "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
7
7
  "homepage": "https://puckeditor.com",