@measured/puck 0.21.0-canary.77444503 → 0.21.0-canary.7c2f9283

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 (46) hide show
  1. package/dist/{Editor-O447AVCX.mjs → Editor-32UYWE6W.mjs} +10 -10
  2. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-OFE6QLI2.mjs → Render-FXZX6NFH.mjs} +1 -1
  5. package/dist/{actions-ONhOkrvf.d.mts → actions-BkBoKAc5.d.mts} +26 -10
  6. package/dist/{actions-ONhOkrvf.d.ts → actions-BkBoKAc5.d.ts} +26 -10
  7. package/dist/{chunk-QAWJTCV5.mjs → chunk-3VQHXASI.mjs} +1 -1
  8. package/dist/{chunk-BSDEIOEK.mjs → chunk-6KNQXLQR.mjs} +10 -8
  9. package/dist/{chunk-CSSRLPHM.mjs → chunk-AOEDIUVK.mjs} +1 -1
  10. package/dist/{chunk-4277WLKB.mjs → chunk-FCCNEDWR.mjs} +4373 -3687
  11. package/dist/{chunk-PLXSMBAA.mjs → chunk-GVKHZNTR.mjs} +1 -1
  12. package/dist/{chunk-DAQLMM2T.mjs → chunk-K562SEXI.mjs} +97 -6
  13. package/dist/{chunk-QBGM4ELA.mjs → chunk-KN3XDS7U.mjs} +1 -1
  14. package/dist/{chunk-62AAYNXG.mjs → chunk-MEL7FUSF.mjs} +1 -1
  15. package/dist/{chunk-Y656T6AQ.mjs → chunk-NYGQH27S.mjs} +100 -74
  16. package/dist/{chunk-NLUHDYVR.mjs → chunk-Q3TJ2VYO.mjs} +23 -3
  17. package/dist/{chunk-T3WX7XJ6.mjs → chunk-REWRIUGR.mjs} +33 -9
  18. package/dist/{chunk-2Q4PACDA.mjs → chunk-V2IQTPPK.mjs} +4 -4
  19. package/dist/{full-BEMDJKDS.mjs → full-4OS3O57Y.mjs} +8 -8
  20. package/dist/{index-BEoNHRI1.d.ts → index-bqD1SEOb.d.mts} +3 -1
  21. package/dist/{index-DfxZ7tZF.d.mts → index-lt1zf5WR.d.ts} +3 -1
  22. package/dist/index.css +732 -341
  23. package/dist/index.d.mts +28 -9
  24. package/dist/index.d.ts +28 -9
  25. package/dist/index.js +3340 -2427
  26. package/dist/index.mjs +21 -18
  27. package/dist/internal.d.mts +2 -2
  28. package/dist/internal.d.ts +2 -2
  29. package/dist/internal.js +22 -3
  30. package/dist/internal.mjs +2 -2
  31. package/dist/{loaded-JU3A7Y4L.mjs → loaded-DCQVLO7I.mjs} +5 -5
  32. package/dist/{loaded-N3FYGF2Y.mjs → loaded-JGRO7BH7.mjs} +5 -5
  33. package/dist/{loaded-OBY7OMS6.mjs → loaded-KKVJE5KH.mjs} +5 -5
  34. package/dist/no-external.css +870 -475
  35. package/dist/no-external.d.mts +4 -4
  36. package/dist/no-external.d.ts +4 -4
  37. package/dist/no-external.js +3347 -2431
  38. package/dist/no-external.mjs +20 -12
  39. package/dist/rsc.css +28 -27
  40. package/dist/rsc.d.mts +2 -2
  41. package/dist/rsc.d.ts +2 -2
  42. package/dist/rsc.js +146 -83
  43. package/dist/rsc.mjs +4 -4
  44. package/dist/{walk-tree-CdriEzFJ.d.mts → walk-tree-CRRDqx6_.d.mts} +1 -1
  45. package/dist/{walk-tree-DHbAZ4wF.d.ts → walk-tree-CS7sEpfG.d.ts} +1 -1
  46. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -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-4277WLKB.mjs";
17
- import "./chunk-2Q4PACDA.mjs";
20
+ } from "./chunk-FCCNEDWR.mjs";
21
+ import "./chunk-V2IQTPPK.mjs";
18
22
  import {
19
23
  migrate,
20
24
  resolveAllData,
21
25
  transformProps
22
- } from "./chunk-Y656T6AQ.mjs";
23
- import "./chunk-CSSRLPHM.mjs";
26
+ } from "./chunk-NYGQH27S.mjs";
27
+ import "./chunk-AOEDIUVK.mjs";
24
28
  import {
25
29
  Action,
26
30
  ActionBar,
@@ -29,23 +33,18 @@ import {
29
33
  Label,
30
34
  RichTextMenu,
31
35
  Separator
32
- } from "./chunk-BSDEIOEK.mjs";
33
- import "./chunk-PLXSMBAA.mjs";
34
- import "./chunk-62AAYNXG.mjs";
35
- import "./chunk-QAWJTCV5.mjs";
36
- import "./chunk-DAQLMM2T.mjs";
37
- import "./chunk-QBGM4ELA.mjs";
38
- import "./chunk-T3WX7XJ6.mjs";
36
+ } from "./chunk-6KNQXLQR.mjs";
37
+ import "./chunk-GVKHZNTR.mjs";
38
+ import "./chunk-MEL7FUSF.mjs";
39
+ import "./chunk-3VQHXASI.mjs";
40
+ import "./chunk-K562SEXI.mjs";
41
+ import "./chunk-KN3XDS7U.mjs";
42
+ import "./chunk-REWRIUGR.mjs";
39
43
  import "./chunk-Y2EFNT5P.mjs";
40
44
  import {
41
45
  walkTree
42
- } from "./chunk-NLUHDYVR.mjs";
43
- import {
44
- init_react_import
45
- } from "./chunk-M6W7YEVX.mjs";
46
-
47
- // bundle/index.ts
48
- init_react_import();
46
+ } from "./chunk-Q3TJ2VYO.mjs";
47
+ import "./chunk-M6W7YEVX.mjs";
49
48
  export {
50
49
  Action,
51
50
  ActionBar,
@@ -61,8 +60,12 @@ export {
61
60
  Render,
62
61
  RichTextMenu,
63
62
  Separator,
63
+ blocksPlugin,
64
64
  createUsePuck,
65
+ fieldsPlugin,
66
+ legacySideBarPlugin,
65
67
  migrate,
68
+ outlinePlugin,
66
69
  overrideKeys,
67
70
  registerOverlayPortal,
68
71
  renderContext,
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-ONhOkrvf.mjs';
3
- import { A as AppStore } from './index-DfxZ7tZF.mjs';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BkBoKAc5.mjs';
3
+ import { A as AppStore } from './index-bqD1SEOb.mjs';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-ONhOkrvf.js';
3
- import { A as AppStore } from './index-BEoNHRI1.js';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BkBoKAc5.js';
3
+ import { A as AppStore } from './index-lt1zf5WR.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
package/dist/internal.js CHANGED
@@ -212,12 +212,12 @@ var walkObject = ({
212
212
  }
213
213
  return flatten(newProps);
214
214
  };
215
- function mapFields(item, mappers, config, recurseSlots = false) {
215
+ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
216
216
  var _a, _b, _c, _d, _e;
217
217
  const itemType = "type" in item ? item.type : "root";
218
218
  const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
219
219
  const newProps = walkObject({
220
- value: defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}),
220
+ value: shouldDefaultSlots ? defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}) : item.props,
221
221
  fields: (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {},
222
222
  mappers,
223
223
  id: item.props ? (_e = item.props.id) != null ? _e : "root" : "root",
@@ -245,9 +245,28 @@ var stripSlots = (data, config) => {
245
245
 
246
246
  // lib/data/flatten-node.ts
247
247
  var { flatten: flatten2, unflatten } = import_flat.default;
248
+ function isEmptyArrayOrObject(val) {
249
+ if (Array.isArray(val)) {
250
+ return val.length === 0;
251
+ }
252
+ if (val != null && Object.prototype.toString.call(val) === "[object Object]") {
253
+ return Object.keys(val).length === 0;
254
+ }
255
+ return false;
256
+ }
257
+ function stripEmptyObjects(props) {
258
+ const result = {};
259
+ for (const key in props) {
260
+ if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
261
+ const val = props[key];
262
+ if (isEmptyArrayOrObject(val)) continue;
263
+ result[key] = val;
264
+ }
265
+ return result;
266
+ }
248
267
  var flattenNode = (node, config) => {
249
268
  return __spreadProps(__spreadValues({}, node), {
250
- props: flatten2(stripSlots(node, config).props)
269
+ props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
251
270
  });
252
271
  };
253
272
 
package/dist/internal.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createReducer
3
- } from "./chunk-QBGM4ELA.mjs";
4
- import "./chunk-NLUHDYVR.mjs";
3
+ } from "./chunk-KN3XDS7U.mjs";
4
+ import "./chunk-Q3TJ2VYO.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-PLXSMBAA.mjs";
3
+ } from "./chunk-GVKHZNTR.mjs";
4
4
  import {
5
5
  AlignLeft,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-DAQLMM2T.mjs";
9
- import "./chunk-QBGM4ELA.mjs";
10
- import "./chunk-T3WX7XJ6.mjs";
8
+ } from "./chunk-K562SEXI.mjs";
9
+ import "./chunk-KN3XDS7U.mjs";
10
+ import "./chunk-REWRIUGR.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
12
- import "./chunk-NLUHDYVR.mjs";
12
+ import "./chunk-Q3TJ2VYO.mjs";
13
13
  import {
14
14
  init_react_import
15
15
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useListOptions
3
- } from "./chunk-QAWJTCV5.mjs";
3
+ } from "./chunk-3VQHXASI.mjs";
4
4
  import {
5
5
  List,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-DAQLMM2T.mjs";
9
- import "./chunk-QBGM4ELA.mjs";
10
- import "./chunk-T3WX7XJ6.mjs";
8
+ } from "./chunk-K562SEXI.mjs";
9
+ import "./chunk-KN3XDS7U.mjs";
10
+ import "./chunk-REWRIUGR.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
12
- import "./chunk-NLUHDYVR.mjs";
12
+ import "./chunk-Q3TJ2VYO.mjs";
13
13
  import {
14
14
  init_react_import
15
15
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useHeadingOptions
3
- } from "./chunk-62AAYNXG.mjs";
3
+ } from "./chunk-MEL7FUSF.mjs";
4
4
  import {
5
5
  Heading,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-DAQLMM2T.mjs";
9
- import "./chunk-QBGM4ELA.mjs";
10
- import "./chunk-T3WX7XJ6.mjs";
8
+ } from "./chunk-K562SEXI.mjs";
9
+ import "./chunk-KN3XDS7U.mjs";
10
+ import "./chunk-REWRIUGR.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
12
- import "./chunk-NLUHDYVR.mjs";
12
+ import "./chunk-Q3TJ2VYO.mjs";
13
13
  import {
14
14
  init_react_import
15
15
  } from "./chunk-M6W7YEVX.mjs";