@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.d1e8fa71

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 (50) hide show
  1. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  2. package/dist/{Editor-N46HUQEC.mjs → Editor-L3JAAT2X.mjs} +13 -10
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
  5. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-tsxxcX1z.d.mts} +24 -35
  6. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-tsxxcX1z.d.ts} +24 -35
  7. package/dist/chunk-23IZFPL7.mjs +528 -0
  8. package/dist/{chunk-C2TVYIYC.mjs → chunk-3SDLQIUZ.mjs} +57 -43
  9. package/dist/chunk-45I5SDOI.mjs +134 -0
  10. package/dist/{chunk-DNF2EMM4.mjs → chunk-5ZZVX2Z3.mjs} +2 -2
  11. package/dist/chunk-AOEDIUVK.mjs +11 -0
  12. package/dist/{chunk-DJSH5REF.mjs → chunk-B7REOAA7.mjs} +24 -126
  13. package/dist/{chunk-K3V4LVUL.mjs → chunk-BXQQARCR.mjs} +14 -10
  14. package/dist/{chunk-TB3SSIAY.mjs → chunk-CQUAWHOK.mjs} +5224 -4509
  15. package/dist/{chunk-7KY6RHEY.mjs → chunk-D2SRL6YA.mjs} +101 -524
  16. package/dist/{chunk-GQKMOYLG.mjs → chunk-LJEGWHDD.mjs} +2 -2
  17. package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
  18. package/dist/{chunk-FNWOH4R6.mjs → chunk-PBAAIKXA.mjs} +8 -6
  19. package/dist/{chunk-3QHWXJEI.mjs → chunk-U4VSQKO3.mjs} +2 -2
  20. package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/{full-NLUNPJWS.mjs → full-L7DWVNTZ.mjs} +10 -7
  23. package/dist/index-Ca6V6NQD.d.ts +118 -0
  24. package/dist/index-mQvUCH3C.d.mts +118 -0
  25. package/dist/index.css +732 -341
  26. package/dist/index.d.mts +29 -120
  27. package/dist/index.d.ts +29 -120
  28. package/dist/index.js +3273 -2392
  29. package/dist/index.mjs +22 -16
  30. package/dist/internal.d.mts +27 -0
  31. package/dist/internal.d.ts +27 -0
  32. package/dist/internal.js +927 -0
  33. package/dist/internal.mjs +13 -0
  34. package/dist/{loaded-HMSPJUZM.mjs → loaded-2HLHDP2G.mjs} +7 -4
  35. package/dist/{loaded-EV34KGYJ.mjs → loaded-LZUXYAGW.mjs} +7 -4
  36. package/dist/{loaded-ZXOU6S6R.mjs → loaded-UHVTB6OD.mjs} +7 -4
  37. package/dist/no-external.css +870 -475
  38. package/dist/no-external.d.mts +4 -2
  39. package/dist/no-external.d.ts +4 -2
  40. package/dist/no-external.js +3276 -2392
  41. package/dist/no-external.mjs +22 -11
  42. package/dist/rsc.css +28 -27
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +56 -29
  46. package/dist/rsc.mjs +6 -4
  47. package/dist/walk-tree-Bh85NMeo.d.ts +29 -0
  48. package/dist/walk-tree-CDA3K5S3.d.mts +29 -0
  49. package/package.json +9 -4
  50. package/dist/chunk-WUWXFMEM.mjs +0 -11
@@ -6,21 +6,25 @@ import {
6
6
  FieldLabel,
7
7
  Puck,
8
8
  Render,
9
+ blocksPlugin,
9
10
  createUsePuck,
11
+ fieldsPlugin,
12
+ legacySideBarPlugin,
13
+ outlinePlugin,
10
14
  overrideKeys,
11
15
  registerOverlayPortal,
12
16
  renderContext,
13
17
  setDeep,
14
18
  useGetPuck,
15
19
  usePuck
16
- } from "./chunk-TB3SSIAY.mjs";
20
+ } from "./chunk-CQUAWHOK.mjs";
21
+ import "./chunk-PBAAIKXA.mjs";
17
22
  import {
18
23
  migrate,
19
24
  resolveAllData,
20
25
  transformProps
21
- } from "./chunk-C2TVYIYC.mjs";
22
- import "./chunk-FNWOH4R6.mjs";
23
- import "./chunk-WUWXFMEM.mjs";
26
+ } from "./chunk-3SDLQIUZ.mjs";
27
+ import "./chunk-AOEDIUVK.mjs";
24
28
  import {
25
29
  Action,
26
30
  ActionBar,
@@ -29,17 +33,20 @@ import {
29
33
  Label,
30
34
  RichTextMenu,
31
35
  Separator
32
- } from "./chunk-K3V4LVUL.mjs";
33
- import "./chunk-GQKMOYLG.mjs";
34
- import "./chunk-DNF2EMM4.mjs";
35
- import "./chunk-3QHWXJEI.mjs";
36
- import "./chunk-7KY6RHEY.mjs";
36
+ } from "./chunk-BXQQARCR.mjs";
37
+ import "./chunk-LJEGWHDD.mjs";
38
+ import "./chunk-5ZZVX2Z3.mjs";
39
+ import "./chunk-U4VSQKO3.mjs";
40
+ import "./chunk-D2SRL6YA.mjs";
41
+ import "./chunk-23IZFPL7.mjs";
42
+ import "./chunk-45I5SDOI.mjs";
43
+ import "./chunk-Y2EFNT5P.mjs";
37
44
  import {
38
45
  walkTree
39
- } from "./chunk-DJSH5REF.mjs";
46
+ } from "./chunk-B7REOAA7.mjs";
40
47
  import {
41
48
  init_react_import
42
- } from "./chunk-DCSQEDMK.mjs";
49
+ } from "./chunk-M6W7YEVX.mjs";
43
50
 
44
51
  // bundle/no-external.ts
45
52
  init_react_import();
@@ -58,8 +65,12 @@ export {
58
65
  Render,
59
66
  RichTextMenu,
60
67
  Separator,
68
+ blocksPlugin,
61
69
  createUsePuck,
70
+ fieldsPlugin,
71
+ legacySideBarPlugin,
62
72
  migrate,
73
+ outlinePlugin,
63
74
  overrideKeys,
64
75
  registerOverlayPortal,
65
76
  renderContext,
package/dist/rsc.css CHANGED
@@ -1,44 +1,44 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
2
- ._RichTextEditor_1elol_1 .ProseMirror {
2
+ ._RichTextEditor_z25h4_1 .ProseMirror {
3
3
  white-space: pre-wrap;
4
4
  word-wrap: break-word;
5
5
  cursor: text;
6
6
  outline: none;
7
7
  position: relative;
8
8
  }
9
- ._RichTextEditor_1elol_1 .rich-text * {
9
+ ._RichTextEditor_z25h4_1 .rich-text * {
10
10
  white-space: pre-wrap;
11
11
  user-select: auto;
12
12
  -webkit-user-select: auto;
13
13
  }
14
- ._RichTextEditor_1elol_1 .rich-text blockquote {
14
+ ._RichTextEditor_z25h4_1 .rich-text blockquote {
15
15
  margin: 1em 0;
16
16
  padding: 0 1em;
17
17
  border-left: 4px solid var(--puck-color-grey-09);
18
18
  }
19
- ._RichTextEditor_1elol_1 .rich-text code {
19
+ ._RichTextEditor_z25h4_1 .rich-text code {
20
20
  background-color: var(--puck-color-grey-11);
21
21
  padding: 4px 8px;
22
22
  border-radius: 4px;
23
23
  }
24
- ._RichTextEditor_1elol_1 .rich-text p:empty::before {
24
+ ._RichTextEditor_z25h4_1 .rich-text p:empty::before {
25
25
  content: "\a0";
26
26
  }
27
- ._RichTextEditor_1elol_1 .rich-text pre code {
27
+ ._RichTextEditor_z25h4_1 .rich-text pre code {
28
28
  display: block;
29
29
  padding: 8px 12px;
30
30
  }
31
- ._RichTextEditor_1elol_1 .rich-text > *:first-child,
32
- ._RichTextEditor_1elol_1 .ProseMirror > *:first-child,
33
- ._RichTextEditor_1elol_1 .rich-text * p:first-of-type {
31
+ ._RichTextEditor_z25h4_1 .rich-text > *:first-child,
32
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:first-child,
33
+ ._RichTextEditor_z25h4_1 .rich-text * p:first-of-type {
34
34
  margin-top: 0;
35
35
  }
36
- ._RichTextEditor_1elol_1 .rich-text > *:last-child,
37
- ._RichTextEditor_1elol_1 .ProseMirror > *:last-child,
38
- ._RichTextEditor_1elol_1 .rich-text * p:last-of-type {
36
+ ._RichTextEditor_z25h4_1 .rich-text > *:last-child,
37
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:last-child,
38
+ ._RichTextEditor_z25h4_1 .rich-text * p:last-of-type {
39
39
  margin-bottom: 0;
40
40
  }
41
- ._RichTextEditor--editor_1elol_50 {
41
+ ._RichTextEditor--editor_z25h4_50 {
42
42
  background: var(--puck-color-white);
43
43
  border-width: 1px;
44
44
  border-style: solid;
@@ -50,52 +50,53 @@
50
50
  font-family: inherit;
51
51
  font-size: var(--puck-font-size-xxs);
52
52
  resize: vertical;
53
+ text-align: initial;
53
54
  transition: border-color 50ms ease-in;
54
55
  width: 100%;
55
56
  max-width: 100%;
56
57
  min-height: 128px;
57
58
  }
58
- ._RichTextEditor--editor_1elol_50 .rich-text {
59
+ ._RichTextEditor--editor_z25h4_50 .rich-text {
59
60
  flex-grow: 1;
60
61
  }
61
- ._RichTextEditor--editor_1elol_50 .rich-text:not(:has(.ProseMirror)),
62
- ._RichTextEditor--editor_1elol_50 .rich-text .ProseMirror {
62
+ ._RichTextEditor--editor_z25h4_50 .rich-text:not(:has(.ProseMirror)),
63
+ ._RichTextEditor--editor_z25h4_50 .rich-text .ProseMirror {
63
64
  height: 100%;
64
65
  padding: 12px 15px;
65
66
  }
66
- ._RichTextEditor--editor_1elol_50 .rich-text ul,
67
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
67
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul,
68
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
68
69
  padding-left: 24px;
69
70
  }
70
- ._RichTextEditor--editor_1elol_50 .rich-text li {
71
+ ._RichTextEditor--editor_z25h4_50 .rich-text li {
71
72
  line-height: 1.5;
72
73
  }
73
- ._RichTextEditor--editor_1elol_50 .rich-text p {
74
+ ._RichTextEditor--editor_z25h4_50 .rich-text p {
74
75
  margin-block: 12px;
75
76
  }
76
- ._RichTextEditor--editor_1elol_50 .rich-text ul {
77
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul {
77
78
  list-style: disc;
78
79
  }
79
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
80
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
80
81
  list-style: decimal;
81
82
  }
82
- ._RichTextEditor--editor_1elol_50:focus-within {
83
+ ._RichTextEditor--editor_z25h4_50:focus-within {
83
84
  border-color: var(--puck-color-grey-05);
84
85
  outline: 2px solid var(--puck-color-azure-05);
85
86
  transition: none;
86
87
  }
87
- ._RichTextEditor--editor_1elol_50._RichTextEditor--disabled_1elol_106 {
88
+ ._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
88
89
  background: var(--puck-color-grey-11);
89
90
  }
90
- ._RichTextEditor_1elol_1:not(:focus-within):not(._RichTextEditor--isActive_1elol_110) .ProseMirror ::selection {
91
+ ._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
91
92
  background-color: transparent;
92
93
  }
93
- ._RichTextEditor-menu_1elol_116 {
94
+ ._RichTextEditor-menu_z25h4_117 {
94
95
  border-bottom: 1px solid var(--puck-color-grey-10);
95
96
  position: sticky;
96
97
  top: 0;
97
98
  z-index: 1;
98
99
  }
99
- ._RichTextEditor--disabled_1elol_106 ._RichTextEditor-menu_1elol_116 {
100
+ ._RichTextEditor--disabled_z25h4_107 ._RichTextEditor-menu_z25h4_117 {
100
101
  border-bottom: 1px solid var(--puck-color-grey-09);
101
102
  }
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-Ja9bNCM9.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ja9bNCM9.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-tsxxcX1z.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CDA3K5S3.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-Ja9bNCM9.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ja9bNCM9.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-tsxxcX1z.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Bh85NMeo.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
package/dist/rsc.js CHANGED
@@ -199,7 +199,7 @@ var init_styles_module = __esm({
199
199
  "use strict";
200
200
  init_react_import();
201
201
  init_css_module_data();
202
- styles_module_default = { "RichTextEditor": "_RichTextEditor_1elol_1", "RichTextEditor--editor": "_RichTextEditor--editor_1elol_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_1elol_106", "RichTextEditor--isActive": "_RichTextEditor--isActive_1elol_110", "RichTextEditor-menu": "_RichTextEditor-menu_1elol_116" };
202
+ styles_module_default = { "RichTextEditor": "_RichTextEditor_z25h4_1", "RichTextEditor--editor": "_RichTextEditor--editor_z25h4_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_z25h4_107", "RichTextEditor--isActive": "_RichTextEditor--isActive_z25h4_111", "RichTextEditor-menu": "_RichTextEditor-menu_z25h4_117" };
203
203
  }
204
204
  });
205
205
 
@@ -529,12 +529,12 @@ var walkObject = ({
529
529
  }
530
530
  return flatten(newProps);
531
531
  };
532
- function mapFields(item, mappers, config, recurseSlots = false) {
532
+ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
533
533
  var _a, _b, _c, _d, _e;
534
534
  const itemType = "type" in item ? item.type : "root";
535
535
  const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
536
536
  const newProps = walkObject({
537
- value: defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}),
537
+ value: shouldDefaultSlots ? defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}) : item.props,
538
538
  fields: (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {},
539
539
  mappers,
540
540
  id: item.props ? (_e = item.props.id) != null ? _e : "root" : "root",
@@ -552,32 +552,38 @@ function mapFields(item, mappers, config, recurseSlots = false) {
552
552
  });
553
553
  }
554
554
 
555
+ // lib/field-transforms/build-mappers.ts
556
+ init_react_import();
557
+ function buildMappers(transforms, readOnly, forceReadOnly) {
558
+ return Object.keys(transforms).reduce((acc, _fieldType) => {
559
+ const fieldType = _fieldType;
560
+ return __spreadProps(__spreadValues({}, acc), {
561
+ [fieldType]: (_a) => {
562
+ var _b = _a, {
563
+ parentId
564
+ } = _b, params = __objRest(_b, [
565
+ "parentId"
566
+ ]);
567
+ const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
568
+ const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
569
+ const fn = transforms[fieldType];
570
+ return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
571
+ isReadOnly,
572
+ componentId: parentId
573
+ }));
574
+ }
575
+ });
576
+ }, {});
577
+ }
578
+
555
579
  // lib/field-transforms/use-field-transforms.tsx
556
580
  function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
557
- const mappers = (0, import_react2.useMemo)(() => {
558
- return Object.keys(transforms).reduce((acc, _fieldType) => {
559
- const fieldType = _fieldType;
560
- return __spreadProps(__spreadValues({}, acc), {
561
- [fieldType]: (_a) => {
562
- var _b = _a, {
563
- parentId
564
- } = _b, params = __objRest(_b, [
565
- "parentId"
566
- ]);
567
- const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
568
- const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
569
- const fn = transforms[fieldType];
570
- return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
571
- isReadOnly,
572
- componentId: parentId
573
- }));
574
- }
575
- });
576
- }, {});
577
- }, [transforms, readOnly, forceReadOnly]);
581
+ const mappers = (0, import_react2.useMemo)(
582
+ () => buildMappers(transforms, readOnly, forceReadOnly),
583
+ [transforms, readOnly, forceReadOnly]
584
+ );
578
585
  const transformedProps = (0, import_react2.useMemo)(() => {
579
- const mapped = mapFields(item, mappers, config).props;
580
- return mapped;
586
+ return mapFields(item, mappers, config).props;
581
587
  }, [config, item, mappers]);
582
588
  const mergedProps = (0, import_react2.useMemo)(
583
589
  () => __spreadValues(__spreadValues({}, item.props), transformedProps),
@@ -1040,7 +1046,8 @@ init_react_import();
1040
1046
  var defaultViewports = [
1041
1047
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1042
1048
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1043
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1049
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1050
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1044
1051
  ];
1045
1052
 
1046
1053
  // store/default-app-state.ts
@@ -1062,7 +1069,8 @@ var defaultAppState = {
1062
1069
  options: [],
1063
1070
  controlsVisible: true
1064
1071
  },
1065
- field: { focus: null }
1072
+ field: { focus: null },
1073
+ plugin: { current: null }
1066
1074
  },
1067
1075
  indexes: {
1068
1076
  nodes: {},
@@ -1110,9 +1118,28 @@ var stripSlots = (data, config) => {
1110
1118
 
1111
1119
  // lib/data/flatten-node.ts
1112
1120
  var { flatten: flatten2, unflatten } = import_flat.default;
1121
+ function isEmptyArrayOrObject(val) {
1122
+ if (Array.isArray(val)) {
1123
+ return val.length === 0;
1124
+ }
1125
+ if (val != null && Object.prototype.toString.call(val) === "[object Object]") {
1126
+ return Object.keys(val).length === 0;
1127
+ }
1128
+ return false;
1129
+ }
1130
+ function stripEmptyObjects(props) {
1131
+ const result = {};
1132
+ for (const key in props) {
1133
+ if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
1134
+ const val = props[key];
1135
+ if (isEmptyArrayOrObject(val)) continue;
1136
+ result[key] = val;
1137
+ }
1138
+ return result;
1139
+ }
1113
1140
  var flattenNode = (node, config) => {
1114
1141
  return __spreadProps(__spreadValues({}, node), {
1115
- props: flatten2(stripSlots(node, config).props)
1142
+ props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
1116
1143
  });
1117
1144
  };
1118
1145
 
package/dist/rsc.mjs CHANGED
@@ -5,20 +5,22 @@ import {
5
5
  transformProps,
6
6
  useRichtextProps,
7
7
  useSlots
8
- } from "./chunk-C2TVYIYC.mjs";
9
- import "./chunk-WUWXFMEM.mjs";
8
+ } from "./chunk-3SDLQIUZ.mjs";
9
+ import "./chunk-AOEDIUVK.mjs";
10
+ import "./chunk-45I5SDOI.mjs";
11
+ import "./chunk-Y2EFNT5P.mjs";
10
12
  import {
11
13
  rootAreaId,
12
14
  rootDroppableId,
13
15
  rootZone,
14
16
  setupZone,
15
17
  walkTree
16
- } from "./chunk-DJSH5REF.mjs";
18
+ } from "./chunk-B7REOAA7.mjs";
17
19
  import {
18
20
  __spreadProps,
19
21
  __spreadValues,
20
22
  init_react_import
21
- } from "./chunk-DCSQEDMK.mjs";
23
+ } from "./chunk-M6W7YEVX.mjs";
22
24
 
23
25
  // bundle/rsc.tsx
24
26
  init_react_import();
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.c78dc826",
3
+ "version": "0.21.0-canary.d1e8fa71",
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.0.1",
80
- "@types/react-dom": "^19.0.2",
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",
@@ -1,11 +0,0 @@
1
- import {
2
- init_react_import
3
- } from "./chunk-DCSQEDMK.mjs";
4
-
5
- // css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css#css-module
6
- init_react_import();
7
- var styles_module_default = { "RichTextEditor": "_RichTextEditor_1elol_1", "RichTextEditor--editor": "_RichTextEditor--editor_1elol_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_1elol_106", "RichTextEditor--isActive": "_RichTextEditor--isActive_1elol_110", "RichTextEditor-menu": "_RichTextEditor-menu_1elol_116" };
8
-
9
- export {
10
- styles_module_default
11
- };