@puckeditor/core 0.23.0 → 0.24.0-canary.03e660bb

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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{Editor-44C53YAG.mjs → Editor-7KNCA6HK.mjs} +9 -9
  3. package/dist/{Render-DQXAYUBI.mjs → Render-H3USS5FU.mjs} +2 -2
  4. package/dist/{actions-DA1J5F56.d.mts → actions-BEt6vA0O.d.mts} +78 -20
  5. package/dist/{actions-DA1J5F56.d.ts → actions-BEt6vA0O.d.ts} +78 -20
  6. package/dist/{chunk-YQWFSBOU.mjs → chunk-3GJJSXCL.mjs} +138 -50
  7. package/dist/{chunk-55V3NZVF.mjs → chunk-DQGTW26I.mjs} +1678 -1064
  8. package/dist/{chunk-NJTGWYYH.mjs → chunk-EPCBCOJF.mjs} +1 -1
  9. package/dist/{chunk-4P4VZS4P.mjs → chunk-I4C7LRQ7.mjs} +1 -1
  10. package/dist/{chunk-GNR2HNTB.mjs → chunk-J6CJWYPQ.mjs} +8 -8
  11. package/dist/{chunk-WF6I3XOL.mjs → chunk-NZHU34KT.mjs} +4 -4
  12. package/dist/{chunk-Y2EFNT5P.mjs → chunk-OT7NKYY4.mjs} +2 -2
  13. package/dist/{chunk-K2LNXU54.mjs → chunk-SBDTCWI2.mjs} +109 -76
  14. package/dist/{chunk-67Y7M4OJ.mjs → chunk-VCJQYLHO.mjs} +1 -1
  15. package/dist/{chunk-ZRAERXB4.mjs → chunk-XMN55NON.mjs} +3 -2
  16. package/dist/{chunk-2CNEFIQP.mjs → chunk-ZOLLDKZQ.mjs} +4 -1
  17. package/dist/{full-7ZJV44EE.mjs → full-FCIISNOL.mjs} +7 -7
  18. package/dist/{index-DIZKfHDN.d.ts → index-BjizoAHc.d.ts} +1 -1
  19. package/dist/{index-n9eR_SWx.d.mts → index-Cw7CQGG8.d.mts} +1 -1
  20. package/dist/index.css +217 -51
  21. package/dist/index.d.mts +50 -9
  22. package/dist/index.d.ts +50 -9
  23. package/dist/index.js +2227 -1485
  24. package/dist/index.mjs +16 -10
  25. package/dist/internal.d.mts +2 -2
  26. package/dist/internal.d.ts +2 -2
  27. package/dist/{loaded-36WRJPBT.mjs → loaded-6K36DBBN.mjs} +4 -4
  28. package/dist/{loaded-SMPR6KZF.mjs → loaded-GZTG57BI.mjs} +4 -4
  29. package/dist/{loaded-JKA25A3T.mjs → loaded-SBKSTOMK.mjs} +4 -4
  30. package/dist/no-external.css +217 -51
  31. package/dist/no-external.d.mts +4 -4
  32. package/dist/no-external.d.ts +4 -4
  33. package/dist/no-external.js +2227 -1485
  34. package/dist/no-external.mjs +16 -10
  35. package/dist/rsc.d.mts +4 -3
  36. package/dist/rsc.d.ts +4 -3
  37. package/dist/rsc.js +194 -71
  38. package/dist/rsc.mjs +51 -21
  39. package/dist/{walk-tree-DbY5zG2K.d.ts → walk-tree-COvy_ERJ.d.ts} +1 -1
  40. package/dist/{walk-tree-DHP1pWEM.d.mts → walk-tree-CrM-tWuf.d.mts} +1 -1
  41. package/package.json +34 -33
package/dist/rsc.mjs CHANGED
@@ -3,12 +3,11 @@ import {
3
3
  migrate,
4
4
  resolveAllData,
5
5
  transformProps,
6
- useRichtextProps,
7
- useSlots
8
- } from "./chunk-YQWFSBOU.mjs";
6
+ use_render_props_default
7
+ } from "./chunk-3GJJSXCL.mjs";
9
8
  import "./chunk-H635BA2V.mjs";
10
- import "./chunk-ZRAERXB4.mjs";
11
- import "./chunk-Y2EFNT5P.mjs";
9
+ import "./chunk-XMN55NON.mjs";
10
+ import "./chunk-OT7NKYY4.mjs";
12
11
  import {
13
12
  rootAreaId,
14
13
  rootDroppableId,
@@ -32,7 +31,8 @@ function DropZoneRenderItem({
32
31
  item,
33
32
  data,
34
33
  config,
35
- metadata
34
+ metadata,
35
+ fieldTransforms
36
36
  }) {
37
37
  const Component = config.components[item.type];
38
38
  const props = __spreadProps(__spreadValues({}, item.props), {
@@ -44,7 +44,8 @@ function DropZoneRenderItem({
44
44
  data,
45
45
  areaId: item.props.id,
46
46
  config,
47
- metadata
47
+ metadata,
48
+ fieldTransforms
48
49
  }
49
50
  ),
50
51
  metadata,
@@ -53,19 +54,31 @@ function DropZoneRenderItem({
53
54
  }
54
55
  });
55
56
  const renderItem = __spreadProps(__spreadValues({}, item), { props });
56
- const propsWithSlots = useSlots(config, renderItem, (slotProps) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
57
- const richtextProps = useRichtextProps(Component == null ? void 0 : Component.fields, propsWithSlots);
57
+ const renderProps = use_render_props_default(
58
+ config,
59
+ renderItem,
60
+ (slotProps) => /* @__PURE__ */ jsx(
61
+ SlotRenderPure,
62
+ __spreadProps(__spreadValues({}, slotProps), {
63
+ config,
64
+ metadata,
65
+ fieldTransforms
66
+ })
67
+ ),
68
+ fieldTransforms
69
+ );
58
70
  if (!Component) {
59
71
  return null;
60
72
  }
61
- return /* @__PURE__ */ jsx(Component.render, __spreadValues(__spreadValues({}, propsWithSlots), richtextProps));
73
+ return /* @__PURE__ */ jsx(Component.render, __spreadValues({}, renderProps));
62
74
  }
63
75
  function DropZoneRender({
64
76
  zone,
65
77
  data,
66
78
  areaId = "root",
67
79
  config,
68
- metadata = {}
80
+ metadata = {},
81
+ fieldTransforms
69
82
  }) {
70
83
  let zoneCompound = rootDroppableId;
71
84
  let content = (data == null ? void 0 : data.content) || [];
@@ -83,7 +96,8 @@ function DropZoneRender({
83
96
  item,
84
97
  data,
85
98
  config,
86
- metadata
99
+ metadata,
100
+ fieldTransforms
87
101
  },
88
102
  item.props.id
89
103
  );
@@ -92,9 +106,11 @@ function DropZoneRender({
92
106
  function Render({
93
107
  config,
94
108
  data,
95
- metadata = {}
109
+ metadata = {},
110
+ fieldTransforms: userFieldTransforms
96
111
  }) {
97
- var _a, _b;
112
+ var _a;
113
+ const fieldTransforms = userFieldTransforms;
98
114
  const rootProps = "props" in data.root ? data.root.props : data.root;
99
115
  const title = rootProps.title || "";
100
116
  const props = __spreadProps(__spreadValues({}, rootProps), {
@@ -105,7 +121,8 @@ function Render({
105
121
  zone,
106
122
  data,
107
123
  config,
108
- metadata
124
+ metadata,
125
+ fieldTransforms
109
126
  }
110
127
  ),
111
128
  isEditing: false,
@@ -116,16 +133,28 @@ function Render({
116
133
  editMode: false,
117
134
  id: "puck-root"
118
135
  });
119
- const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
120
- const richtextProps = useRichtextProps((_a = config.root) == null ? void 0 : _a.fields, props);
121
- if ((_b = config.root) == null ? void 0 : _b.render) {
122
- return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues(__spreadValues({}, propsWithSlots), richtextProps), { children: /* @__PURE__ */ jsx(
136
+ const renderProps = use_render_props_default(
137
+ config,
138
+ { type: "root", props },
139
+ (props2) => /* @__PURE__ */ jsx(
140
+ SlotRenderPure,
141
+ __spreadProps(__spreadValues({}, props2), {
142
+ config,
143
+ metadata,
144
+ fieldTransforms
145
+ })
146
+ ),
147
+ fieldTransforms
148
+ );
149
+ if ((_a = config.root) == null ? void 0 : _a.render) {
150
+ return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues({}, renderProps), { children: /* @__PURE__ */ jsx(
123
151
  DropZoneRender,
124
152
  {
125
153
  config,
126
154
  data,
127
155
  zone: rootZone,
128
- metadata
156
+ metadata,
157
+ fieldTransforms
129
158
  }
130
159
  ) }));
131
160
  }
@@ -135,7 +164,8 @@ function Render({
135
164
  config,
136
165
  data,
137
166
  zone: rootZone,
138
- metadata
167
+ metadata,
168
+ fieldTransforms
139
169
  }
140
170
  );
141
171
  }
@@ -1,4 +1,4 @@
1
- import { m as Config, D as Data, at as WithId, ao as UserGenerics, o as Content, i as ComponentData, s as DefaultComponents, r as DefaultComponentProps, t as DefaultRootFieldProps, X as Metadata, ae as RootData } from './actions-DA1J5F56.js';
1
+ import { n as Config, D as Data, au as WithId, ap as UserGenerics, p as Content, j as ComponentData, t as DefaultComponents, s as DefaultComponentProps, u as DefaultRootFieldProps, Y as Metadata, af as RootData } from './actions-BEt6vA0O.js';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
@@ -1,4 +1,4 @@
1
- import { m as Config, D as Data, at as WithId, ao as UserGenerics, o as Content, i as ComponentData, s as DefaultComponents, r as DefaultComponentProps, t as DefaultRootFieldProps, X as Metadata, ae as RootData } from './actions-DA1J5F56.mjs';
1
+ import { n as Config, D as Data, au as WithId, ap as UserGenerics, p as Content, j as ComponentData, t as DefaultComponents, s as DefaultComponentProps, u as DefaultRootFieldProps, Y as Metadata, af as RootData } from './actions-BEt6vA0O.mjs';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.23.0",
3
+ "version": "0.24.0-canary.03e660bb",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
- "repository": "puckeditor/puck",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "puckeditor/puck"
9
+ },
7
10
  "bugs": "https://github.com/puckeditor/puck/issues",
8
11
  "homepage": "https://puckeditor.com",
9
12
  "keywords": [
@@ -66,13 +69,6 @@
66
69
  "engines": {
67
70
  "node": ">=20.0.0"
68
71
  },
69
- "scripts": {
70
- "lint": "eslint \"**/*.ts*\"",
71
- "build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts",
72
- "test": "jest",
73
- "prepare": "cp ../../README.md . && yarn build",
74
- "postpublish": "rm README.md"
75
- },
76
72
  "files": [
77
73
  "dist"
78
74
  ],
@@ -91,7 +87,7 @@
91
87
  "css-box-model": "^1.2.1",
92
88
  "esbuild": "^0.25.11",
93
89
  "eslint": "^9.0.0",
94
- "eslint-config-custom": "*",
90
+ "eslint-config-custom": "0.0.0",
95
91
  "identity-obj-proxy": "^3.0.0",
96
92
  "jest": "^29.7.0",
97
93
  "jest-environment-jsdom": "^30.0.0-beta.3",
@@ -100,9 +96,9 @@
100
96
  "postcss-modules": "^6.0.1",
101
97
  "ts-jest": "^29.3.4",
102
98
  "ts-node": "^10.9.2",
103
- "tsconfig": "*",
99
+ "tsconfig": "0.0.0",
104
100
  "tsup": "^8.2.4",
105
- "tsup-config": "*",
101
+ "tsup-config": "0.0.0",
106
102
  "typescript": "^5.5.4"
107
103
  },
108
104
  "dependencies": {
@@ -114,26 +110,26 @@
114
110
  "@dnd-kit/state": "0.4.0",
115
111
  "@radix-ui/react-popover": "^1.1.15",
116
112
  "@tanstack/react-virtual": "^3.13.9",
117
- "@tiptap/core": "^3.11.1",
118
- "@tiptap/extension-blockquote": "^3.11.1",
119
- "@tiptap/extension-bold": "^3.11.1",
120
- "@tiptap/extension-code": "^3.11.1",
121
- "@tiptap/extension-code-block": "^3.11.1",
122
- "@tiptap/extension-document": "^3.11.1",
123
- "@tiptap/extension-hard-break": "^3.11.1",
124
- "@tiptap/extension-heading": "^3.11.1",
125
- "@tiptap/extension-horizontal-rule": "^3.11.1",
126
- "@tiptap/extension-italic": "^3.11.1",
127
- "@tiptap/extension-link": "^3.11.1",
128
- "@tiptap/extension-list": "^3.11.1",
129
- "@tiptap/extension-paragraph": "^3.11.1",
130
- "@tiptap/extension-strike": "^3.11.1",
131
- "@tiptap/extension-text": "^3.11.1",
132
- "@tiptap/extension-text-align": "^3.11.1",
133
- "@tiptap/extension-underline": "^3.11.1",
134
- "@tiptap/html": "^3.11.1",
135
- "@tiptap/pm": "^3.11.1",
136
- "@tiptap/react": "^3.11.1",
113
+ "@tiptap/core": "^3.30.4",
114
+ "@tiptap/extension-blockquote": "^3.30.4",
115
+ "@tiptap/extension-bold": "^3.30.4",
116
+ "@tiptap/extension-code": "^3.30.4",
117
+ "@tiptap/extension-code-block": "^3.30.4",
118
+ "@tiptap/extension-document": "^3.30.4",
119
+ "@tiptap/extension-hard-break": "^3.30.4",
120
+ "@tiptap/extension-heading": "^3.30.4",
121
+ "@tiptap/extension-horizontal-rule": "^3.30.4",
122
+ "@tiptap/extension-italic": "^3.30.4",
123
+ "@tiptap/extension-link": "^3.30.4",
124
+ "@tiptap/extension-list": "^3.30.4",
125
+ "@tiptap/extension-paragraph": "^3.30.4",
126
+ "@tiptap/extension-strike": "^3.30.4",
127
+ "@tiptap/extension-text": "^3.30.4",
128
+ "@tiptap/extension-text-align": "^3.30.4",
129
+ "@tiptap/extension-underline": "^3.30.4",
130
+ "@tiptap/html": "^3.30.4",
131
+ "@tiptap/pm": "^3.30.4",
132
+ "@tiptap/react": "^3.30.4",
137
133
  "deep-diff": "^1.0.2",
138
134
  "fast-equals": "5.2.2",
139
135
  "flat": "^5.0.2",
@@ -145,5 +141,10 @@
145
141
  },
146
142
  "peerDependencies": {
147
143
  "react": "^18.0.0 || ^19.0.0"
144
+ },
145
+ "scripts": {
146
+ "lint": "eslint \"**/*.ts*\"",
147
+ "build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts",
148
+ "test": "jest"
148
149
  }
149
- }
150
+ }