@measured/puck 0.16.0-canary.6386bd1 → 0.16.0-canary.6d43ba0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Config-VOJqVbHe.d.ts → Config-XUGMjfT5.d.mts} +58 -39
- package/dist/Config-XUGMjfT5.d.ts +281 -0
- package/dist/chunk-TM7CT64S.mjs +113 -0
- package/dist/index.css +95 -78
- package/dist/index.d.mts +389 -0
- package/dist/index.d.ts +52 -15
- package/dist/index.js +881 -29070
- package/dist/index.mjs +5855 -0
- package/dist/rsc.d.mts +10 -0
- package/dist/rsc.d.ts +1 -1
- package/dist/rsc.mjs +80 -0
- package/package.json +14 -6
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-XUGMjfT5.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.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config, D as Data } from './Config-
|
2
|
+
import { C as Config, D as Data } from './Config-XUGMjfT5.js';
|
3
3
|
import 'react';
|
4
4
|
|
5
5
|
declare function Render<UserConfig extends Config = Config>({ config, data, }: {
|
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.
|
3
|
+
"version": "0.16.0-canary.6d43ba0",
|
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
|
-
"
|
14
|
-
|
15
|
-
|
13
|
+
"react-server": {
|
14
|
+
"import": "./dist/rsc.mjs",
|
15
|
+
"require": "./dist/rsc.js",
|
16
|
+
"types": "./dist/rsc.d.ts"
|
17
|
+
},
|
18
|
+
"default": {
|
19
|
+
"import": "./dist/index.mjs",
|
20
|
+
"require": "./dist/index.js",
|
21
|
+
"types": "./dist/index.d.ts"
|
22
|
+
}
|
16
23
|
},
|
17
24
|
"./rsc": {
|
18
|
-
"import": "./dist/rsc.
|
25
|
+
"import": "./dist/rsc.mjs",
|
19
26
|
"require": "./dist/rsc.js",
|
20
27
|
"types": "./dist/rsc.d.ts"
|
21
28
|
},
|
@@ -44,9 +51,11 @@
|
|
44
51
|
"@testing-library/react": "^14.0.0",
|
45
52
|
"@types/deep-diff": "^1.0.3",
|
46
53
|
"@types/jest": "^29.5.4",
|
54
|
+
"@types/object-hash": "^3.0.6",
|
47
55
|
"@types/react": "^18.2.0",
|
48
56
|
"@types/react-dom": "^18.2.0",
|
49
57
|
"@types/ua-parser-js": "^0.7.39",
|
58
|
+
"@types/uuid": "^10.0.0",
|
50
59
|
"css-box-model": "^1.2.1",
|
51
60
|
"eslint": "^7.32.0",
|
52
61
|
"eslint-config-custom": "*",
|
@@ -63,7 +72,6 @@
|
|
63
72
|
"@measured/dnd": "16.6.0-canary.4cba1d1",
|
64
73
|
"deep-diff": "^1.0.2",
|
65
74
|
"object-hash": "^3.0.0",
|
66
|
-
"react-frame-component": "^5.2.6",
|
67
75
|
"react-hotkeys-hook": "^4.4.1",
|
68
76
|
"ua-parser-js": "^1.0.37",
|
69
77
|
"use-debounce": "^9.0.4",
|