@measured/puck 0.16.0-canary.abe8c52 → 0.16.0-canary.c379051
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/{Config-VOJqVbHe.d.ts → Config-CkVFT1_w.d.mts} +15 -1
- package/dist/Config-CkVFT1_w.d.ts +276 -0
- package/dist/chunk-TM7CT64S.mjs +113 -0
- package/dist/index.css +95 -78
- package/dist/index.d.mts +391 -0
- package/dist/index.d.ts +44 -6
- package/dist/index.js +742 -28974
- package/dist/index.mjs +5843 -0
- package/dist/rsc.d.mts +10 -0
- package/dist/rsc.d.ts +1 -1
- package/dist/rsc.mjs +80 -0
- package/package.json +12 -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-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.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-CkVFT1_w.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.c379051",
|
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
|
},
|
@@ -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",
|