@measured/puck 0.21.0-canary.d32e582b → 0.21.0-canary.d5f934f0

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 (52) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-STTYPZJ4.mjs +204 -0
  3. package/dist/Render-OFE6QLI2.mjs +55 -0
  4. package/dist/Render-QEMDIDQC.css +101 -0
  5. package/dist/{walk-tree-DiatHoF-.d.mts → actions-tsxxcX1z.d.mts} +268 -77
  6. package/dist/{walk-tree-DiatHoF-.d.ts → actions-tsxxcX1z.d.ts} +268 -77
  7. package/dist/chunk-5ATHPL4L.mjs +111 -0
  8. package/dist/chunk-6K3HTV5G.mjs +419 -0
  9. package/dist/chunk-CSSRLPHM.mjs +11 -0
  10. package/dist/chunk-DBBPIWHH.mjs +528 -0
  11. package/dist/{chunk-VVS2EUKT.mjs → chunk-GUTA7GLC.mjs} +4915 -6674
  12. package/dist/chunk-IDHXWXYL.mjs +1807 -0
  13. package/dist/chunk-M6W7YEVX.mjs +95 -0
  14. package/dist/chunk-MML4TKL2.mjs +63 -0
  15. package/dist/chunk-O7X34GXV.mjs +708 -0
  16. package/dist/chunk-ODDSBBX3.mjs +435 -0
  17. package/dist/chunk-PRRLVCLF.mjs +33 -0
  18. package/dist/chunk-QV3IXRNS.mjs +134 -0
  19. package/dist/chunk-V5I7CVLT.mjs +103 -0
  20. package/dist/chunk-VL2VNWXO.mjs +53 -0
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/full-2GJTAAZE.css +301 -0
  23. package/dist/full-C4C2K2OO.mjs +93 -0
  24. package/dist/index-Ca6V6NQD.d.ts +118 -0
  25. package/dist/index-mQvUCH3C.d.mts +118 -0
  26. package/dist/index.css +403 -133
  27. package/dist/index.d.mts +106 -115
  28. package/dist/index.d.ts +106 -115
  29. package/dist/index.js +6891 -3492
  30. package/dist/index.mjs +28 -12
  31. package/dist/internal.d.mts +27 -0
  32. package/dist/internal.d.ts +27 -0
  33. package/dist/internal.js +927 -0
  34. package/dist/internal.mjs +13 -0
  35. package/dist/loaded-DB2OXVC5.mjs +57 -0
  36. package/dist/loaded-GEFHNL7S.mjs +57 -0
  37. package/dist/loaded-RVWBFK7L.css +87 -0
  38. package/dist/loaded-TVTW742N.mjs +60 -0
  39. package/dist/no-external.css +550 -276
  40. package/dist/no-external.d.mts +19 -2
  41. package/dist/no-external.d.ts +19 -2
  42. package/dist/no-external.js +6887 -3485
  43. package/dist/no-external.mjs +30 -9
  44. package/dist/rsc.css +101 -0
  45. package/dist/rsc.d.mts +17 -2
  46. package/dist/rsc.d.ts +17 -2
  47. package/dist/rsc.js +443 -37
  48. package/dist/rsc.mjs +18 -9
  49. package/dist/walk-tree-Bh85NMeo.d.ts +29 -0
  50. package/dist/walk-tree-CDA3K5S3.d.mts +29 -0
  51. package/package.json +51 -5
  52. package/dist/chunk-XYKLHT4R.mjs +0 -966
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-6K3HTV5G.mjs";
9
+ import "./chunk-CSSRLPHM.mjs";
10
+ import "./chunk-QV3IXRNS.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-XYKLHT4R.mjs";
18
+ } from "./chunk-ODDSBBX3.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
- if ((_a = config.root) == null ? void 0 : _a.render) {
95
- return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues({}, propsWithSlots), { children: /* @__PURE__ */ jsx(
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-tsxxcX1z.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-tsxxcX1z.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,10 +1,29 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.d32e582b",
3
+ "version": "0.21.0-canary.d5f934f0",
4
+ "description": "The open-source visual editor for React",
4
5
  "author": "Chris Villa <chris@puckeditor.com>",
5
6
  "repository": "measuredco/puck",
6
7
  "bugs": "https://github.com/measuredco/puck/issues",
7
8
  "homepage": "https://puckeditor.com",
9
+ "keywords": [
10
+ "puck",
11
+ "visual",
12
+ "editor",
13
+ "react",
14
+ "drag and drop",
15
+ "dnd",
16
+ "page",
17
+ "website",
18
+ "builder",
19
+ "headless",
20
+ "cms",
21
+ "low-code",
22
+ "no-code",
23
+ "javascript",
24
+ "typescript",
25
+ "WYSIWYG"
26
+ ],
8
27
  "private": false,
9
28
  "main": "./dist/index.js",
10
29
  "types": "./dist/index.d.ts",
@@ -26,6 +45,11 @@
26
45
  "import": "./dist/rsc.mjs",
27
46
  "require": "./dist/rsc.js"
28
47
  },
48
+ "./internal": {
49
+ "types": "./dist/internal.d.ts",
50
+ "import": "./dist/internal.mjs",
51
+ "require": "./dist/internal.js"
52
+ },
29
53
  "./puck.css": "./dist/index.css",
30
54
  "./no-external.css": "./dist/no-external.css",
31
55
  "./dist/index.css": "./dist/index.css",
@@ -41,7 +65,7 @@
41
65
  "license": "MIT",
42
66
  "scripts": {
43
67
  "lint": "eslint \"**/*.ts*\"",
44
- "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",
45
69
  "test": "jest",
46
70
  "prepare": "cp ../../README.md . && yarn build",
47
71
  "postpublish": "rm README.md"
@@ -57,8 +81,8 @@
57
81
  "@types/flat": "^5.0.5",
58
82
  "@types/jest": "^29.5.14",
59
83
  "@types/object-hash": "^3.0.6",
60
- "@types/react": "^19.0.1",
61
- "@types/react-dom": "^19.0.2",
84
+ "@types/react": "^19.2.7",
85
+ "@types/react-dom": "^19.2.3",
62
86
  "@types/uuid": "^10.0.0",
63
87
  "css-box-model": "^1.2.1",
64
88
  "eslint": "^7.32.0",
@@ -76,9 +100,31 @@
76
100
  "dependencies": {
77
101
  "@dnd-kit/helpers": "0.1.18",
78
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",
79
124
  "deep-diff": "^1.0.2",
80
- "fast-deep-equal": "^3.1.3",
125
+ "fast-equals": "5.2.2",
81
126
  "flat": "^5.0.2",
127
+ "happy-dom": "^20.0.10",
82
128
  "object-hash": "^3.0.0",
83
129
  "react-hotkeys-hook": "^4.6.1",
84
130
  "use-debounce": "^9.0.4",