@measured/puck 0.21.0-canary.f5820ce9 → 0.21.0-canary.fee2ba98
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/Editor-EHVB6NFF.mjs +204 -0
- package/dist/Editor-F2LSS6SE.css +403 -0
- package/dist/Render-OFE6QLI2.mjs +55 -0
- package/dist/Render-QEMDIDQC.css +101 -0
- package/dist/{walk-tree-Ctf3FZQI.d.mts → actions-DwdqNb63.d.mts} +265 -75
- package/dist/{walk-tree-Ctf3FZQI.d.ts → actions-DwdqNb63.d.ts} +265 -75
- package/dist/chunk-2334PLLL.mjs +111 -0
- package/dist/chunk-4N3WJM5Y.mjs +33 -0
- package/dist/{chunk-AO6Y47WD.mjs → chunk-6AGLD64M.mjs} +4819 -6477
- package/dist/chunk-CSSRLPHM.mjs +11 -0
- package/dist/chunk-D6RJOV2Z.mjs +1727 -0
- package/dist/chunk-M6W7YEVX.mjs +95 -0
- package/dist/chunk-NLUHDYVR.mjs +416 -0
- package/dist/chunk-NQEE2254.mjs +706 -0
- package/dist/chunk-PXYVL42X.mjs +53 -0
- package/dist/chunk-QBGM4ELA.mjs +528 -0
- package/dist/chunk-QLQZDFXM.mjs +63 -0
- package/dist/chunk-T3WX7XJ6.mjs +132 -0
- package/dist/chunk-V5I7CVLT.mjs +103 -0
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/chunk-Y656T6AQ.mjs +419 -0
- package/dist/full-2GJTAAZE.css +301 -0
- package/dist/full-TVZATY2K.mjs +93 -0
- package/dist/index-AfAtzigt.d.ts +117 -0
- package/dist/index-jxA1wrW4.d.mts +117 -0
- package/dist/index.css +278 -22
- package/dist/index.d.mts +99 -113
- package/dist/index.d.ts +99 -113
- package/dist/index.js +6647 -3315
- package/dist/index.mjs +26 -12
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +908 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-ICVILKS6.mjs +60 -0
- package/dist/loaded-IHAGHNLA.mjs +57 -0
- package/dist/loaded-ONU7LATV.mjs +57 -0
- package/dist/loaded-RVWBFK7L.css +87 -0
- package/dist/no-external.css +425 -165
- package/dist/no-external.d.mts +19 -2
- package/dist/no-external.d.ts +19 -2
- package/dist/no-external.js +6646 -3311
- package/dist/no-external.mjs +28 -9
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +417 -30
- package/dist/rsc.mjs +18 -9
- package/dist/walk-tree-DRy9ca1P.d.ts +29 -0
- package/dist/walk-tree-Dppc3XGY.d.mts +29 -0
- package/package.json +31 -4
- package/dist/chunk-VBJEDLUM.mjs +0 -965
package/dist/rsc.mjs
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SlotRenderPure,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues,
|
|
5
|
-
init_react_import,
|
|
6
3
|
migrate,
|
|
7
4
|
resolveAllData,
|
|
5
|
+
transformProps,
|
|
6
|
+
useRichtextProps,
|
|
7
|
+
useSlots
|
|
8
|
+
} from "./chunk-Y656T6AQ.mjs";
|
|
9
|
+
import "./chunk-CSSRLPHM.mjs";
|
|
10
|
+
import "./chunk-T3WX7XJ6.mjs";
|
|
11
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
+
import {
|
|
8
13
|
rootAreaId,
|
|
9
14
|
rootDroppableId,
|
|
10
15
|
rootZone,
|
|
11
16
|
setupZone,
|
|
12
|
-
transformProps,
|
|
13
|
-
useSlots,
|
|
14
17
|
walkTree
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NLUHDYVR.mjs";
|
|
19
|
+
import {
|
|
20
|
+
__spreadProps,
|
|
21
|
+
__spreadValues,
|
|
22
|
+
init_react_import
|
|
23
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
16
24
|
|
|
17
25
|
// bundle/rsc.tsx
|
|
18
26
|
init_react_import();
|
|
@@ -68,7 +76,7 @@ function Render({
|
|
|
68
76
|
data,
|
|
69
77
|
metadata = {}
|
|
70
78
|
}) {
|
|
71
|
-
var _a;
|
|
79
|
+
var _a, _b;
|
|
72
80
|
const rootProps = "props" in data.root ? data.root.props : data.root;
|
|
73
81
|
const title = rootProps.title || "";
|
|
74
82
|
const props = __spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -91,8 +99,9 @@ function Render({
|
|
|
91
99
|
id: "puck-root"
|
|
92
100
|
});
|
|
93
101
|
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
const richtextProps = useRichtextProps((_a = config.root) == null ? void 0 : _a.fields, props);
|
|
103
|
+
if ((_b = config.root) == null ? void 0 : _b.render) {
|
|
104
|
+
return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues(__spreadValues({}, propsWithSlots), richtextProps), { children: /* @__PURE__ */ jsx(
|
|
96
105
|
DropZoneRender,
|
|
97
106
|
{
|
|
98
107
|
config,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-DwdqNb63.js';
|
|
2
|
+
|
|
3
|
+
type MigrationOptions<UserConfig extends Config> = {
|
|
4
|
+
migrateDynamicZonesForComponent?: {
|
|
5
|
+
[ComponentName in keyof UserConfig["components"]]: (props: WithId<UserGenerics<UserConfig>["UserProps"][ComponentName]>, zones: Record<string, Content>) => ComponentData["props"];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare function migrate<UserConfig extends Config = Config>(data: Data, config?: UserConfig, migrationOptions?: MigrationOptions<UserConfig>): Data;
|
|
9
|
+
|
|
10
|
+
type PropTransform<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
|
|
11
|
+
[ComponentName in keyof Components]: (props: Components[ComponentName] & {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}) => Components[ComponentName];
|
|
14
|
+
} & {
|
|
15
|
+
root: (props: RootProps & {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}) => RootProps;
|
|
18
|
+
}>;
|
|
19
|
+
declare function transformProps<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Components, RootProps>, config?: Config): Data;
|
|
20
|
+
|
|
21
|
+
declare function resolveAllData<Components extends DefaultComponents = DefaultComponents, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Components, RootProps>>;
|
|
22
|
+
|
|
23
|
+
type WalkTreeOptions = {
|
|
24
|
+
parentId: string;
|
|
25
|
+
propName: string;
|
|
26
|
+
};
|
|
27
|
+
declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
|
|
28
|
+
|
|
29
|
+
export { migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-DwdqNb63.mjs';
|
|
2
|
+
|
|
3
|
+
type MigrationOptions<UserConfig extends Config> = {
|
|
4
|
+
migrateDynamicZonesForComponent?: {
|
|
5
|
+
[ComponentName in keyof UserConfig["components"]]: (props: WithId<UserGenerics<UserConfig>["UserProps"][ComponentName]>, zones: Record<string, Content>) => ComponentData["props"];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare function migrate<UserConfig extends Config = Config>(data: Data, config?: UserConfig, migrationOptions?: MigrationOptions<UserConfig>): Data;
|
|
9
|
+
|
|
10
|
+
type PropTransform<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
|
|
11
|
+
[ComponentName in keyof Components]: (props: Components[ComponentName] & {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}) => Components[ComponentName];
|
|
14
|
+
} & {
|
|
15
|
+
root: (props: RootProps & {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}) => RootProps;
|
|
18
|
+
}>;
|
|
19
|
+
declare function transformProps<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Components, RootProps>, config?: Config): Data;
|
|
20
|
+
|
|
21
|
+
declare function resolveAllData<Components extends DefaultComponents = DefaultComponents, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Components, RootProps>>;
|
|
22
|
+
|
|
23
|
+
type WalkTreeOptions = {
|
|
24
|
+
parentId: string;
|
|
25
|
+
propName: string;
|
|
26
|
+
};
|
|
27
|
+
declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
|
|
28
|
+
|
|
29
|
+
export { migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@measured/puck",
|
|
3
|
-
"version": "0.21.0-canary.
|
|
3
|
+
"version": "0.21.0-canary.fee2ba98",
|
|
4
4
|
"description": "The open-source visual editor for React",
|
|
5
5
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
6
6
|
"repository": "measuredco/puck",
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"import": "./dist/rsc.mjs",
|
|
46
46
|
"require": "./dist/rsc.js"
|
|
47
47
|
},
|
|
48
|
+
"./internal": {
|
|
49
|
+
"types": "./dist/internal.d.ts",
|
|
50
|
+
"import": "./dist/internal.mjs",
|
|
51
|
+
"require": "./dist/internal.js"
|
|
52
|
+
},
|
|
48
53
|
"./puck.css": "./dist/index.css",
|
|
49
54
|
"./no-external.css": "./dist/no-external.css",
|
|
50
55
|
"./dist/index.css": "./dist/index.css",
|
|
@@ -60,7 +65,7 @@
|
|
|
60
65
|
"license": "MIT",
|
|
61
66
|
"scripts": {
|
|
62
67
|
"lint": "eslint \"**/*.ts*\"",
|
|
63
|
-
"build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts",
|
|
68
|
+
"build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts",
|
|
64
69
|
"test": "jest",
|
|
65
70
|
"prepare": "cp ../../README.md . && yarn build",
|
|
66
71
|
"postpublish": "rm README.md"
|
|
@@ -76,8 +81,8 @@
|
|
|
76
81
|
"@types/flat": "^5.0.5",
|
|
77
82
|
"@types/jest": "^29.5.14",
|
|
78
83
|
"@types/object-hash": "^3.0.6",
|
|
79
|
-
"@types/react": "^19.
|
|
80
|
-
"@types/react-dom": "^19.
|
|
84
|
+
"@types/react": "^19.2.7",
|
|
85
|
+
"@types/react-dom": "^19.2.3",
|
|
81
86
|
"@types/uuid": "^10.0.0",
|
|
82
87
|
"css-box-model": "^1.2.1",
|
|
83
88
|
"eslint": "^7.32.0",
|
|
@@ -95,9 +100,31 @@
|
|
|
95
100
|
"dependencies": {
|
|
96
101
|
"@dnd-kit/helpers": "0.1.18",
|
|
97
102
|
"@dnd-kit/react": "0.1.18",
|
|
103
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
104
|
+
"@tiptap/core": "^3.11.1",
|
|
105
|
+
"@tiptap/extension-blockquote": "^3.11.1",
|
|
106
|
+
"@tiptap/extension-bold": "^3.11.1",
|
|
107
|
+
"@tiptap/extension-code": "^3.11.1",
|
|
108
|
+
"@tiptap/extension-code-block": "^3.11.1",
|
|
109
|
+
"@tiptap/extension-document": "^3.11.1",
|
|
110
|
+
"@tiptap/extension-hard-break": "^3.11.1",
|
|
111
|
+
"@tiptap/extension-heading": "^3.11.1",
|
|
112
|
+
"@tiptap/extension-horizontal-rule": "^3.11.1",
|
|
113
|
+
"@tiptap/extension-italic": "^3.11.1",
|
|
114
|
+
"@tiptap/extension-link": "^3.11.1",
|
|
115
|
+
"@tiptap/extension-list": "^3.11.1",
|
|
116
|
+
"@tiptap/extension-paragraph": "^3.11.1",
|
|
117
|
+
"@tiptap/extension-strike": "^3.11.1",
|
|
118
|
+
"@tiptap/extension-text": "^3.11.1",
|
|
119
|
+
"@tiptap/extension-text-align": "^3.11.1",
|
|
120
|
+
"@tiptap/extension-underline": "^3.11.1",
|
|
121
|
+
"@tiptap/html": "^3.11.1",
|
|
122
|
+
"@tiptap/pm": "^3.11.1",
|
|
123
|
+
"@tiptap/react": "^3.11.1",
|
|
98
124
|
"deep-diff": "^1.0.2",
|
|
99
125
|
"fast-equals": "5.2.2",
|
|
100
126
|
"flat": "^5.0.2",
|
|
127
|
+
"happy-dom": "^20.0.10",
|
|
101
128
|
"object-hash": "^3.0.0",
|
|
102
129
|
"react-hotkeys-hook": "^4.6.1",
|
|
103
130
|
"use-debounce": "^9.0.4",
|