@measured/puck 0.21.0-canary.a62292fd → 0.21.0-canary.a7a65997
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-O447AVCX.mjs → Editor-HG76DBFU.mjs} +9 -9
- package/dist/{actions-ONhOkrvf.d.mts → actions-tsxxcX1z.d.mts} +24 -9
- package/dist/{actions-ONhOkrvf.d.ts → actions-tsxxcX1z.d.ts} +24 -9
- package/dist/{chunk-QBGM4ELA.mjs → chunk-23IZFPL7.mjs} +1 -1
- package/dist/{chunk-T3WX7XJ6.mjs → chunk-45I5SDOI.mjs} +5 -3
- package/dist/{chunk-62AAYNXG.mjs → chunk-5ZZVX2Z3.mjs} +1 -1
- package/dist/{chunk-NLUHDYVR.mjs → chunk-B7REOAA7.mjs} +22 -3
- package/dist/{chunk-BSDEIOEK.mjs → chunk-BXQQARCR.mjs} +10 -8
- package/dist/{chunk-DAQLMM2T.mjs → chunk-D2SRL6YA.mjs} +89 -4
- package/dist/{chunk-Y656T6AQ.mjs → chunk-IQKX6A5D.mjs} +49 -39
- package/dist/{chunk-PLXSMBAA.mjs → chunk-LJEGWHDD.mjs} +1 -1
- package/dist/{chunk-2Q4PACDA.mjs → chunk-LR6HIXPR.mjs} +3 -3
- package/dist/{chunk-7GESFTRA.mjs → chunk-Q6MNES6D.mjs} +4315 -3693
- package/dist/{chunk-QAWJTCV5.mjs → chunk-U4VSQKO3.mjs} +1 -1
- package/dist/{full-BEMDJKDS.mjs → full-L7DWVNTZ.mjs} +8 -8
- package/dist/{index-BEoNHRI1.d.ts → index-Ca6V6NQD.d.ts} +3 -1
- package/dist/{index-DfxZ7tZF.d.mts → index-mQvUCH3C.d.mts} +3 -1
- package/dist/index.css +704 -314
- package/dist/index.d.mts +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.js +2975 -2181
- package/dist/index.mjs +20 -17
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +22 -3
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-N3FYGF2Y.mjs → loaded-2HLHDP2G.mjs} +5 -5
- package/dist/{loaded-OBY7OMS6.mjs → loaded-LZUXYAGW.mjs} +5 -5
- package/dist/{loaded-JU3A7Y4L.mjs → loaded-UHVTB6OD.mjs} +5 -5
- package/dist/no-external.css +842 -448
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +2972 -2175
- package/dist/no-external.mjs +19 -11
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +55 -28
- package/dist/rsc.mjs +3 -3
- package/dist/{walk-tree-DHbAZ4wF.d.ts → walk-tree-Bh85NMeo.d.ts} +1 -1
- package/dist/{walk-tree-CdriEzFJ.d.mts → walk-tree-CDA3K5S3.d.mts} +1 -1
- package/package.json +1 -1
package/dist/no-external.mjs
CHANGED
|
@@ -6,20 +6,24 @@ 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-
|
|
17
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-Q6MNES6D.mjs";
|
|
21
|
+
import "./chunk-LR6HIXPR.mjs";
|
|
18
22
|
import {
|
|
19
23
|
migrate,
|
|
20
24
|
resolveAllData,
|
|
21
25
|
transformProps
|
|
22
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IQKX6A5D.mjs";
|
|
23
27
|
import "./chunk-CSSRLPHM.mjs";
|
|
24
28
|
import {
|
|
25
29
|
Action,
|
|
@@ -29,17 +33,17 @@ import {
|
|
|
29
33
|
Label,
|
|
30
34
|
RichTextMenu,
|
|
31
35
|
Separator
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
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";
|
|
39
43
|
import "./chunk-Y2EFNT5P.mjs";
|
|
40
44
|
import {
|
|
41
45
|
walkTree
|
|
42
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-B7REOAA7.mjs";
|
|
43
47
|
import {
|
|
44
48
|
init_react_import
|
|
45
49
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -61,8 +65,12 @@ export {
|
|
|
61
65
|
Render,
|
|
62
66
|
RichTextMenu,
|
|
63
67
|
Separator,
|
|
68
|
+
blocksPlugin,
|
|
64
69
|
createUsePuck,
|
|
70
|
+
fieldsPlugin,
|
|
71
|
+
legacySideBarPlugin,
|
|
65
72
|
migrate,
|
|
73
|
+
outlinePlugin,
|
|
66
74
|
overrideKeys,
|
|
67
75
|
registerOverlayPortal,
|
|
68
76
|
renderContext,
|
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 './actions-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
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 './actions-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
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
|
@@ -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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
|
|
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,9 +5,9 @@ import {
|
|
|
5
5
|
transformProps,
|
|
6
6
|
useRichtextProps,
|
|
7
7
|
useSlots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IQKX6A5D.mjs";
|
|
9
9
|
import "./chunk-CSSRLPHM.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-45I5SDOI.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
12
|
import {
|
|
13
13
|
rootAreaId,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
rootZone,
|
|
16
16
|
setupZone,
|
|
17
17
|
walkTree
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B7REOAA7.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__spreadProps,
|
|
21
21
|
__spreadValues,
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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
2
|
|
|
3
3
|
type MigrationOptions<UserConfig extends Config> = {
|
|
4
4
|
migrateDynamicZonesForComponent?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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
2
|
|
|
3
3
|
type MigrationOptions<UserConfig extends Config> = {
|
|
4
4
|
migrateDynamicZonesForComponent?: {
|
package/package.json
CHANGED