@puckeditor/core 0.21.1 → 0.21.2-canary.0bbe7fec
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/README.md +1 -1
- package/dist/{Editor-NK3TZSR6.mjs → Editor-G7Y32A5X.mjs} +9 -9
- package/dist/{actions-BkBoKAc5.d.mts → actions-C3e2nJ9v.d.mts} +2 -2
- package/dist/{actions-BkBoKAc5.d.ts → actions-C3e2nJ9v.d.ts} +2 -2
- package/dist/{chunk-PMXRXC2B.mjs → chunk-754HNMU2.mjs} +18 -11
- package/dist/{chunk-MSZPUXZP.mjs → chunk-7TULKVSG.mjs} +1 -1
- package/dist/{chunk-MDUBGHWF.mjs → chunk-BOKX3EBR.mjs} +3 -12
- package/dist/{chunk-EBISZQTK.mjs → chunk-DVS6IJRQ.mjs} +3794 -3733
- package/dist/{chunk-TNORMHZU.mjs → chunk-FOGDNETJ.mjs} +4 -4
- package/dist/{chunk-5V242HXR.mjs → chunk-MFEVRMA4.mjs} +7 -7
- package/dist/{chunk-SKJTJUWU.mjs → chunk-NBH4DF6Y.mjs} +1 -1
- package/dist/{chunk-RHVK562Z.mjs → chunk-OLGXKSQT.mjs} +3 -3
- package/dist/{chunk-KOUWDQ4Q.mjs → chunk-OYCFPEDG.mjs} +1 -1
- package/dist/{chunk-UMTU6EA7.mjs → chunk-RSOD4APZ.mjs} +20 -10
- package/dist/{chunk-37HTE4KO.mjs → chunk-YLLE6KXH.mjs} +1 -1
- package/dist/{full-KLPRWVS4.mjs → full-AG4GMB6M.mjs} +8 -8
- package/dist/{index-lt1zf5WR.d.ts → index-DAXMlG_V.d.mts} +2 -1
- package/dist/{index-bqD1SEOb.d.mts → index-s4HBwSMe.d.ts} +2 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +228 -156
- package/dist/index.mjs +17 -12
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +16 -11
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-SJJ63OY2.mjs → loaded-JCBZ5OYD.mjs} +5 -5
- package/dist/{loaded-DIHUQBWF.mjs → loaded-VT5I2E7C.mjs} +5 -5
- package/dist/{loaded-362ACKSQ.mjs → loaded-YDSVEZZY.mjs} +5 -5
- package/dist/no-external.css +143 -147
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +226 -157
- package/dist/no-external.mjs +11 -11
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +50 -35
- package/dist/rsc.mjs +45 -27
- package/dist/{walk-tree-CRRDqx6_.d.mts → walk-tree-BJoNgZ0l.d.mts} +1 -1
- package/dist/{walk-tree-CS7sEpfG.d.ts → walk-tree-f8Yzs5o3.d.ts} +1 -1
- package/package.json +1 -1
package/dist/no-external.mjs
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
setDeep,
|
|
18
18
|
useGetPuck,
|
|
19
19
|
usePuck
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-DVS6IJRQ.mjs";
|
|
21
|
+
import "./chunk-OLGXKSQT.mjs";
|
|
22
22
|
import {
|
|
23
23
|
migrate,
|
|
24
24
|
resolveAllData,
|
|
25
25
|
transformProps
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FOGDNETJ.mjs";
|
|
27
27
|
import "./chunk-AOEDIUVK.mjs";
|
|
28
28
|
import {
|
|
29
29
|
Action,
|
|
@@ -33,17 +33,17 @@ import {
|
|
|
33
33
|
Label,
|
|
34
34
|
RichTextMenu,
|
|
35
35
|
Separator
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-MFEVRMA4.mjs";
|
|
37
|
+
import "./chunk-7TULKVSG.mjs";
|
|
38
|
+
import "./chunk-OYCFPEDG.mjs";
|
|
39
|
+
import "./chunk-NBH4DF6Y.mjs";
|
|
40
|
+
import "./chunk-RSOD4APZ.mjs";
|
|
41
|
+
import "./chunk-YLLE6KXH.mjs";
|
|
42
|
+
import "./chunk-BOKX3EBR.mjs";
|
|
43
43
|
import "./chunk-Y2EFNT5P.mjs";
|
|
44
44
|
import {
|
|
45
45
|
walkTree
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-754HNMU2.mjs";
|
|
47
47
|
import {
|
|
48
48
|
init_react_import
|
|
49
49
|
} from "./chunk-M6W7YEVX.mjs";
|
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-C3e2nJ9v.mjs';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BJoNgZ0l.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-C3e2nJ9v.js';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-f8Yzs5o3.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@tiptap/react';
|
|
6
6
|
import '@tiptap/extension-blockquote';
|
package/dist/rsc.js
CHANGED
|
@@ -755,6 +755,38 @@ var SlotRender = (0, import_react5.forwardRef)(
|
|
|
755
755
|
|
|
756
756
|
// components/ServerRender/index.tsx
|
|
757
757
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
758
|
+
function DropZoneRenderItem({
|
|
759
|
+
item,
|
|
760
|
+
data,
|
|
761
|
+
config,
|
|
762
|
+
metadata
|
|
763
|
+
}) {
|
|
764
|
+
const Component = config.components[item.type];
|
|
765
|
+
const props = __spreadProps(__spreadValues({}, item.props), {
|
|
766
|
+
puck: {
|
|
767
|
+
renderDropZone: ({ zone }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
768
|
+
DropZoneRender,
|
|
769
|
+
{
|
|
770
|
+
zone,
|
|
771
|
+
data,
|
|
772
|
+
areaId: item.props.id,
|
|
773
|
+
config,
|
|
774
|
+
metadata
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
metadata,
|
|
778
|
+
dragRef: null,
|
|
779
|
+
isEditing: false
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
const renderItem = __spreadProps(__spreadValues({}, item), { props });
|
|
783
|
+
const propsWithSlots = useSlots(config, renderItem, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
|
|
784
|
+
const richtextProps = useRichtextProps(Component == null ? void 0 : Component.fields, propsWithSlots);
|
|
785
|
+
if (!Component) {
|
|
786
|
+
return null;
|
|
787
|
+
}
|
|
788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Component.render, __spreadValues(__spreadValues({}, propsWithSlots), richtextProps));
|
|
789
|
+
}
|
|
758
790
|
function DropZoneRender({
|
|
759
791
|
zone,
|
|
760
792
|
data,
|
|
@@ -772,30 +804,16 @@ function DropZoneRender({
|
|
|
772
804
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
773
805
|
}
|
|
774
806
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: content.map((item) => {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
metadata
|
|
786
|
-
}
|
|
787
|
-
),
|
|
788
|
-
metadata,
|
|
789
|
-
dragRef: null,
|
|
790
|
-
isEditing: false
|
|
791
|
-
}
|
|
792
|
-
});
|
|
793
|
-
const renderItem = __spreadProps(__spreadValues({}, item), { props });
|
|
794
|
-
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
795
|
-
if (Component) {
|
|
796
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Component.render, __spreadValues({}, propsWithSlots), renderItem.props.id);
|
|
797
|
-
}
|
|
798
|
-
return null;
|
|
807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
808
|
+
DropZoneRenderItem,
|
|
809
|
+
{
|
|
810
|
+
item,
|
|
811
|
+
data,
|
|
812
|
+
config,
|
|
813
|
+
metadata
|
|
814
|
+
},
|
|
815
|
+
item.props.id
|
|
816
|
+
);
|
|
799
817
|
}) });
|
|
800
818
|
}
|
|
801
819
|
function Render({
|
|
@@ -1276,7 +1294,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
1276
1294
|
id
|
|
1277
1295
|
});
|
|
1278
1296
|
processRelatedZones(item, id, path);
|
|
1279
|
-
const newItem = __spreadProps(__spreadValues({},
|
|
1297
|
+
const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
|
|
1280
1298
|
const thisZoneCompound = path[path.length - 1];
|
|
1281
1299
|
const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
|
|
1282
1300
|
newNodeIndex[id] = {
|
|
@@ -1316,17 +1334,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
1316
1334
|
);
|
|
1317
1335
|
newZones[zoneCompound] = newContent2;
|
|
1318
1336
|
}, newZones);
|
|
1319
|
-
|
|
1320
|
-
{
|
|
1321
|
-
type: "root",
|
|
1322
|
-
props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
|
|
1323
|
-
},
|
|
1324
|
-
[],
|
|
1325
|
-
-1
|
|
1326
|
-
);
|
|
1327
|
-
const root = __spreadProps(__spreadValues({}, state.data.root), {
|
|
1328
|
-
props: processedRoot.props
|
|
1337
|
+
let rootAsComponent = toComponent({
|
|
1338
|
+
props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
|
|
1329
1339
|
});
|
|
1340
|
+
if (state.data.root.readOnly) {
|
|
1341
|
+
rootAsComponent.readOnly = state.data.root.readOnly;
|
|
1342
|
+
}
|
|
1343
|
+
const processedRoot = processItem(rootAsComponent, [], -1);
|
|
1344
|
+
const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
|
|
1330
1345
|
return __spreadProps(__spreadValues({}, state), {
|
|
1331
1346
|
data: {
|
|
1332
1347
|
root,
|
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-FOGDNETJ.mjs";
|
|
9
9
|
import "./chunk-AOEDIUVK.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BOKX3EBR.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-754HNMU2.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__spreadProps,
|
|
21
21
|
__spreadValues,
|
|
@@ -28,6 +28,38 @@ init_react_import();
|
|
|
28
28
|
// components/ServerRender/index.tsx
|
|
29
29
|
init_react_import();
|
|
30
30
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
31
|
+
function DropZoneRenderItem({
|
|
32
|
+
item,
|
|
33
|
+
data,
|
|
34
|
+
config,
|
|
35
|
+
metadata
|
|
36
|
+
}) {
|
|
37
|
+
const Component = config.components[item.type];
|
|
38
|
+
const props = __spreadProps(__spreadValues({}, item.props), {
|
|
39
|
+
puck: {
|
|
40
|
+
renderDropZone: ({ zone }) => /* @__PURE__ */ jsx(
|
|
41
|
+
DropZoneRender,
|
|
42
|
+
{
|
|
43
|
+
zone,
|
|
44
|
+
data,
|
|
45
|
+
areaId: item.props.id,
|
|
46
|
+
config,
|
|
47
|
+
metadata
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
metadata,
|
|
51
|
+
dragRef: null,
|
|
52
|
+
isEditing: false
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
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);
|
|
58
|
+
if (!Component) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsx(Component.render, __spreadValues(__spreadValues({}, propsWithSlots), richtextProps));
|
|
62
|
+
}
|
|
31
63
|
function DropZoneRender({
|
|
32
64
|
zone,
|
|
33
65
|
data,
|
|
@@ -45,30 +77,16 @@ function DropZoneRender({
|
|
|
45
77
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
46
78
|
}
|
|
47
79
|
return /* @__PURE__ */ jsx(Fragment, { children: content.map((item) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
metadata
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
metadata,
|
|
62
|
-
dragRef: null,
|
|
63
|
-
isEditing: false
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const renderItem = __spreadProps(__spreadValues({}, item), { props });
|
|
67
|
-
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
68
|
-
if (Component) {
|
|
69
|
-
return /* @__PURE__ */ jsx(Component.render, __spreadValues({}, propsWithSlots), renderItem.props.id);
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
DropZoneRenderItem,
|
|
82
|
+
{
|
|
83
|
+
item,
|
|
84
|
+
data,
|
|
85
|
+
config,
|
|
86
|
+
metadata
|
|
87
|
+
},
|
|
88
|
+
item.props.id
|
|
89
|
+
);
|
|
72
90
|
}) });
|
|
73
91
|
}
|
|
74
92
|
function Render({
|
|
@@ -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-C3e2nJ9v.mjs';
|
|
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-C3e2nJ9v.js';
|
|
2
2
|
|
|
3
3
|
type MigrationOptions<UserConfig extends Config> = {
|
|
4
4
|
migrateDynamicZonesForComponent?: {
|