@measured/puck 0.16.0-canary.7cac376 → 0.16.0-canary.96ee704

Sign up to get free protection for your applications and to get access to all the features.
package/dist/rsc.d.mts ADDED
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { C as Config, D as Data } from './Config-CkVFT1_w.mjs';
3
+ import 'react';
4
+
5
+ declare function Render<UserConfig extends Config = Config>({ config, data, }: {
6
+ config: UserConfig;
7
+ data: Data;
8
+ }): react_jsx_runtime.JSX.Element;
9
+
10
+ export { Render };
package/dist/rsc.mjs ADDED
@@ -0,0 +1,80 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues,
4
+ init_react_import,
5
+ rootDroppableId,
6
+ setupZone
7
+ } from "./chunk-TM7CT64S.mjs";
8
+
9
+ // rsc.tsx
10
+ init_react_import();
11
+
12
+ // components/ServerRender/index.tsx
13
+ init_react_import();
14
+ import { Fragment, jsx } from "react/jsx-runtime";
15
+ function DropZoneRender({
16
+ zone,
17
+ data,
18
+ areaId = "root",
19
+ config
20
+ }) {
21
+ let zoneCompound = rootDroppableId;
22
+ let content = (data == null ? void 0 : data.content) || [];
23
+ if (!data || !config) {
24
+ return null;
25
+ }
26
+ if (areaId && zone && zone !== rootDroppableId) {
27
+ zoneCompound = `${areaId}:${zone}`;
28
+ content = setupZone(data, zoneCompound).zones[zoneCompound];
29
+ }
30
+ return /* @__PURE__ */ jsx(Fragment, { children: content.map((item) => {
31
+ const Component = config.components[item.type];
32
+ if (Component) {
33
+ return /* @__PURE__ */ jsx(
34
+ Component.render,
35
+ __spreadProps(__spreadValues({}, item.props), {
36
+ puck: {
37
+ renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ jsx(
38
+ DropZoneRender,
39
+ {
40
+ zone: zone2,
41
+ data,
42
+ areaId: item.props.id,
43
+ config
44
+ }
45
+ )
46
+ }
47
+ }),
48
+ item.props.id
49
+ );
50
+ }
51
+ return null;
52
+ }) });
53
+ }
54
+ function Render({
55
+ config,
56
+ data
57
+ }) {
58
+ var _a;
59
+ if ((_a = config.root) == null ? void 0 : _a.render) {
60
+ const rootProps = data.root.props || data.root;
61
+ const title = rootProps.title || "";
62
+ return /* @__PURE__ */ jsx(
63
+ config.root.render,
64
+ __spreadProps(__spreadValues({}, rootProps), {
65
+ puck: {
66
+ renderDropZone: ({ zone }) => /* @__PURE__ */ jsx(DropZoneRender, { zone, data, config }),
67
+ isEditing: false
68
+ },
69
+ title,
70
+ editMode: false,
71
+ id: "puck-root",
72
+ children: /* @__PURE__ */ jsx(DropZoneRender, { config, data, zone: rootDroppableId })
73
+ })
74
+ );
75
+ }
76
+ return /* @__PURE__ */ jsx(DropZoneRender, { config, data, zone: rootDroppableId });
77
+ }
78
+ export {
79
+ Render
80
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.16.0-canary.7cac376",
3
+ "version": "0.16.0-canary.96ee704",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -10,12 +10,19 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.js",
15
- "types": "./dist/index.d.ts"
13
+ "default": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "react-server": {
19
+ "import": "./dist/rsc.mjs",
20
+ "require": "./dist/rsc.js",
21
+ "types": "./dist/rsc.d.ts"
22
+ }
16
23
  },
17
24
  "./rsc": {
18
- "import": "./dist/rsc.js",
25
+ "import": "./dist/rsc.mjs",
19
26
  "require": "./dist/rsc.js",
20
27
  "types": "./dist/rsc.d.ts"
21
28
  },
@@ -63,7 +70,6 @@
63
70
  "@measured/dnd": "16.6.0-canary.4cba1d1",
64
71
  "deep-diff": "^1.0.2",
65
72
  "object-hash": "^3.0.0",
66
- "react-frame-component": "^5.2.6",
67
73
  "react-hotkeys-hook": "^4.4.1",
68
74
  "ua-parser-js": "^1.0.37",
69
75
  "use-debounce": "^9.0.4",