@puckeditor/core 0.22.0-canary.d4985bc0 → 0.22.0-canary.ea2ac3c2
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-NK3TZSR6.mjs → Editor-O3WDTJHV.mjs} +7 -7
- package/dist/{Render-CU35UAWV.mjs → Render-I4N6YQDP.mjs} +1 -1
- package/dist/{chunk-ZUKMN2UE.mjs → chunk-3CJZ5CW3.mjs} +220 -189
- package/dist/{chunk-KOUWDQ4Q.mjs → chunk-6WA3HRH4.mjs} +1 -1
- package/dist/{chunk-TNORMHZU.mjs → chunk-CDUFFBL7.mjs} +2 -2
- package/dist/{chunk-UMTU6EA7.mjs → chunk-EH5IVUJL.mjs} +1 -1
- package/dist/{chunk-MSZPUXZP.mjs → chunk-Q7O6TFQB.mjs} +1 -1
- package/dist/{chunk-Y2EFNT5P.mjs → chunk-Q7WALXIQ.mjs} +2 -2
- package/dist/{chunk-SKJTJUWU.mjs → chunk-TGGRMDFQ.mjs} +1 -1
- package/dist/{chunk-5V242HXR.mjs → chunk-Y4JP7GJG.mjs} +8 -8
- package/dist/{chunk-RHVK562Z.mjs → chunk-ZARHKIBN.mjs} +4 -4
- package/dist/{full-KLPRWVS4.mjs → full-IKKZDCXQ.mjs} +6 -6
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +216 -184
- package/dist/index.mjs +12 -10
- package/dist/{loaded-SJJ63OY2.mjs → loaded-244PGCK6.mjs} +3 -3
- package/dist/{loaded-362ACKSQ.mjs → loaded-CDQ6IGP6.mjs} +3 -3
- package/dist/{loaded-DIHUQBWF.mjs → loaded-IEPYAJGX.mjs} +3 -3
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +216 -184
- package/dist/no-external.mjs +12 -10
- package/dist/rsc.js +2 -2
- package/dist/rsc.mjs +2 -2
- package/package.json +1 -1
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZARHKIBN.mjs";
|
|
8
8
|
import "./chunk-AOEDIUVK.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-Y4JP7GJG.mjs";
|
|
10
|
+
import "./chunk-Q7O6TFQB.mjs";
|
|
11
|
+
import "./chunk-6WA3HRH4.mjs";
|
|
12
|
+
import "./chunk-TGGRMDFQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EH5IVUJL.mjs";
|
|
17
17
|
import "./chunk-37HTE4KO.mjs";
|
|
18
18
|
import "./chunk-MDUBGHWF.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Q7WALXIQ.mjs";
|
|
20
20
|
import "./chunk-PMXRXC2B.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__spreadProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZARHKIBN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CDUFFBL7.mjs";
|
|
14
14
|
import {
|
|
15
15
|
ActionBar,
|
|
16
16
|
IconButton,
|
|
17
17
|
LoadedRichTextMenuInner,
|
|
18
18
|
Loader
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-Y4JP7GJG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
ChevronDown,
|
|
22
22
|
ChevronRight,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
useRegisterHistorySlice,
|
|
69
69
|
useRegisterPermissionsSlice,
|
|
70
70
|
useResetAutoZoom
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-EH5IVUJL.mjs";
|
|
72
72
|
import {
|
|
73
73
|
getItem,
|
|
74
74
|
insert,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-MDUBGHWF.mjs";
|
|
84
84
|
import {
|
|
85
85
|
get_class_name_factory_default
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-Q7WALXIQ.mjs";
|
|
87
87
|
import {
|
|
88
88
|
defaultSlots,
|
|
89
89
|
expandNode,
|
|
@@ -1941,7 +1941,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
1941
1941
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
1942
1942
|
import { Fragment as Fragment4, jsx as jsx17 } from "react/jsx-runtime";
|
|
1943
1943
|
var Editor = lazy(
|
|
1944
|
-
() => import("./Editor-
|
|
1944
|
+
() => import("./Editor-O3WDTJHV.mjs").then((m) => ({
|
|
1945
1945
|
default: m.Editor
|
|
1946
1946
|
}))
|
|
1947
1947
|
);
|
|
@@ -2774,6 +2774,7 @@ var DraggableComponent = ({
|
|
|
2774
2774
|
};
|
|
2775
2775
|
el.setAttribute("data-puck-component", id);
|
|
2776
2776
|
el.setAttribute("data-puck-dnd", id);
|
|
2777
|
+
el.style.position = "relative";
|
|
2777
2778
|
el.addEventListener("click", onClick);
|
|
2778
2779
|
el.addEventListener("mouseover", _onMouseOver);
|
|
2779
2780
|
el.addEventListener("mouseout", _onMouseOut);
|
|
@@ -3573,12 +3574,12 @@ import {
|
|
|
3573
3574
|
} from "react";
|
|
3574
3575
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3575
3576
|
var Editor2 = lazy2(
|
|
3576
|
-
() => import("./Editor-
|
|
3577
|
+
() => import("./Editor-O3WDTJHV.mjs").then((m) => ({
|
|
3577
3578
|
default: m.Editor
|
|
3578
3579
|
}))
|
|
3579
3580
|
);
|
|
3580
3581
|
var RichTextRender = lazy2(
|
|
3581
|
-
() => import("./Render-
|
|
3582
|
+
() => import("./Render-I4N6YQDP.mjs").then((m) => ({
|
|
3582
3583
|
default: m.RichTextRender
|
|
3583
3584
|
}))
|
|
3584
3585
|
);
|
|
@@ -3742,8 +3743,6 @@ var MemoizeComponent = memo6(RenderComponent, (prev, next) => {
|
|
|
3742
3743
|
// components/DropZone/index.tsx
|
|
3743
3744
|
import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3744
3745
|
var getClassName16 = get_class_name_factory_default("DropZone", styles_module_default10);
|
|
3745
|
-
var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
3746
|
-
var RENDER_DEBUG = false;
|
|
3747
3746
|
var InsertPreview = ({
|
|
3748
3747
|
element,
|
|
3749
3748
|
label,
|
|
@@ -3920,199 +3919,230 @@ var DropZoneChild = ({
|
|
|
3920
3919
|
);
|
|
3921
3920
|
};
|
|
3922
3921
|
var DropZoneChildMemo = memo7(DropZoneChild);
|
|
3923
|
-
var
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3922
|
+
var useSlot = ({
|
|
3923
|
+
zone,
|
|
3924
|
+
allow,
|
|
3925
|
+
disallow,
|
|
3926
|
+
minEmptyHeight: userMinEmptyHeight = "128px",
|
|
3927
|
+
collisionAxis
|
|
3928
|
+
}) => {
|
|
3929
|
+
const ctx = useContext7(dropZoneContext);
|
|
3930
|
+
const appStoreApi = useAppStoreApi();
|
|
3931
|
+
const {
|
|
3932
|
+
// These all need setting via context
|
|
3933
|
+
areaId,
|
|
3934
|
+
depth = 0,
|
|
3935
|
+
registerLocalZone,
|
|
3936
|
+
unregisterLocalZone
|
|
3937
|
+
} = ctx != null ? ctx : {};
|
|
3938
|
+
const path = useAppStore(
|
|
3939
|
+
useShallow6((s) => {
|
|
3940
|
+
var _a;
|
|
3941
|
+
return areaId ? (_a = s.state.indexes.nodes[areaId]) == null ? void 0 : _a.path : null;
|
|
3942
|
+
})
|
|
3943
|
+
);
|
|
3944
|
+
let zoneCompound = rootDroppableId;
|
|
3945
|
+
if (areaId) {
|
|
3946
|
+
if (zone !== rootDroppableId) {
|
|
3947
|
+
zoneCompound = `${areaId}:${zone}`;
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
const isRootZone = zoneCompound === rootDroppableId || zone === rootDroppableId || areaId === "root";
|
|
3951
|
+
const inNextDeepestArea = useContextStore(
|
|
3952
|
+
ZoneStoreContext,
|
|
3953
|
+
(s) => s.nextAreaDepthIndex[areaId || ""]
|
|
3954
|
+
);
|
|
3955
|
+
const zoneContentIds = useAppStore(
|
|
3956
|
+
useShallow6((s) => {
|
|
3957
|
+
var _a;
|
|
3958
|
+
return (_a = s.state.indexes.zones[zoneCompound]) == null ? void 0 : _a.contentIds;
|
|
3959
|
+
})
|
|
3960
|
+
);
|
|
3961
|
+
const zoneType = useAppStore(
|
|
3962
|
+
useShallow6((s) => {
|
|
3963
|
+
var _a;
|
|
3964
|
+
return (_a = s.state.indexes.zones[zoneCompound]) == null ? void 0 : _a.type;
|
|
3965
|
+
})
|
|
3966
|
+
);
|
|
3967
|
+
useEffect15(() => {
|
|
3968
|
+
if (!zoneType || zoneType === "dropzone") {
|
|
3969
|
+
if (ctx == null ? void 0 : ctx.registerZone) {
|
|
3970
|
+
ctx == null ? void 0 : ctx.registerZone(zoneCompound);
|
|
3953
3971
|
}
|
|
3954
3972
|
}
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
(
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
var _a;
|
|
3963
|
-
return (_a = s.state.indexes.zones[zoneCompound]) == null ? void 0 : _a.contentIds;
|
|
3964
|
-
})
|
|
3965
|
-
);
|
|
3966
|
-
const zoneType = useAppStore(
|
|
3967
|
-
useShallow6((s) => {
|
|
3968
|
-
var _a;
|
|
3969
|
-
return (_a = s.state.indexes.zones[zoneCompound]) == null ? void 0 : _a.type;
|
|
3970
|
-
})
|
|
3971
|
-
);
|
|
3972
|
-
useEffect15(() => {
|
|
3973
|
-
if (!zoneType || zoneType === "dropzone") {
|
|
3974
|
-
if (ctx == null ? void 0 : ctx.registerZone) {
|
|
3975
|
-
ctx == null ? void 0 : ctx.registerZone(zoneCompound);
|
|
3976
|
-
}
|
|
3973
|
+
}, [zoneType, appStoreApi]);
|
|
3974
|
+
useEffect15(() => {
|
|
3975
|
+
if (zoneType === "dropzone") {
|
|
3976
|
+
if (zoneCompound !== rootDroppableId) {
|
|
3977
|
+
console.warn(
|
|
3978
|
+
"DropZones have been deprecated in favor of slot fields and will be removed in a future version of Puck. Please see the migration guide: https://www.puckeditor.com/docs/guides/migrations/dropzones-to-slots"
|
|
3979
|
+
);
|
|
3977
3980
|
}
|
|
3978
|
-
}
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3981
|
+
}
|
|
3982
|
+
}, [zoneType]);
|
|
3983
|
+
const contentIds = useMemo10(() => {
|
|
3984
|
+
return zoneContentIds || [];
|
|
3985
|
+
}, [zoneContentIds]);
|
|
3986
|
+
const acceptsTarget = useCallback11(
|
|
3987
|
+
(componentType) => {
|
|
3988
|
+
if (!componentType) {
|
|
3989
|
+
return true;
|
|
3986
3990
|
}
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
if (!componentType) {
|
|
3995
|
-
return true;
|
|
3991
|
+
if (disallow) {
|
|
3992
|
+
const defaultedAllow = allow || [];
|
|
3993
|
+
const filteredDisallow = (disallow || []).filter(
|
|
3994
|
+
(item) => defaultedAllow.indexOf(item) === -1
|
|
3995
|
+
);
|
|
3996
|
+
if (filteredDisallow.indexOf(componentType) !== -1) {
|
|
3997
|
+
return false;
|
|
3996
3998
|
}
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
(item) => defaultedAllow.indexOf(item) === -1
|
|
4001
|
-
);
|
|
4002
|
-
if (filteredDisallow.indexOf(componentType) !== -1) {
|
|
4003
|
-
return false;
|
|
4004
|
-
}
|
|
4005
|
-
} else if (allow) {
|
|
4006
|
-
if (allow.indexOf(componentType) === -1) {
|
|
4007
|
-
return false;
|
|
4008
|
-
}
|
|
3999
|
+
} else if (allow) {
|
|
4000
|
+
if (allow.indexOf(componentType) === -1) {
|
|
4001
|
+
return false;
|
|
4009
4002
|
}
|
|
4010
|
-
return true;
|
|
4011
|
-
},
|
|
4012
|
-
[allow, disallow]
|
|
4013
|
-
);
|
|
4014
|
-
const targetAccepted = useContextStore(ZoneStoreContext, (s) => {
|
|
4015
|
-
var _a;
|
|
4016
|
-
const draggedComponentType = (_a = s.draggedItem) == null ? void 0 : _a.data.componentType;
|
|
4017
|
-
return acceptsTarget(draggedComponentType);
|
|
4018
|
-
});
|
|
4019
|
-
const hoveringOverArea = inNextDeepestArea || isRootZone;
|
|
4020
|
-
const isEnabled = useContextStore(ZoneStoreContext, (s) => {
|
|
4021
|
-
var _a;
|
|
4022
|
-
let _isEnabled = true;
|
|
4023
|
-
const isDeepestZone = (_a = s.zoneDepthIndex[zoneCompound]) != null ? _a : false;
|
|
4024
|
-
_isEnabled = isDeepestZone;
|
|
4025
|
-
if (_isEnabled) {
|
|
4026
|
-
_isEnabled = targetAccepted;
|
|
4027
4003
|
}
|
|
4028
|
-
return
|
|
4029
|
-
}
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
)
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
}
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
disabled: !isDropEnabled,
|
|
4056
|
-
collisionDetector: pointerIntersection,
|
|
4057
|
-
type: "dropzone",
|
|
4058
|
-
data: {
|
|
4059
|
-
areaId,
|
|
4060
|
-
depth,
|
|
4061
|
-
isDroppableTarget: targetAccepted,
|
|
4062
|
-
path: path || []
|
|
4004
|
+
return true;
|
|
4005
|
+
},
|
|
4006
|
+
[allow, disallow]
|
|
4007
|
+
);
|
|
4008
|
+
const targetAccepted = useContextStore(ZoneStoreContext, (s) => {
|
|
4009
|
+
var _a;
|
|
4010
|
+
const draggedComponentType = (_a = s.draggedItem) == null ? void 0 : _a.data.componentType;
|
|
4011
|
+
return acceptsTarget(draggedComponentType);
|
|
4012
|
+
});
|
|
4013
|
+
const hoveringOverArea = inNextDeepestArea || isRootZone;
|
|
4014
|
+
const isEnabled = useContextStore(ZoneStoreContext, (s) => {
|
|
4015
|
+
var _a;
|
|
4016
|
+
let _isEnabled = true;
|
|
4017
|
+
const isDeepestZone = (_a = s.zoneDepthIndex[zoneCompound]) != null ? _a : false;
|
|
4018
|
+
_isEnabled = isDeepestZone;
|
|
4019
|
+
if (_isEnabled) {
|
|
4020
|
+
_isEnabled = targetAccepted;
|
|
4021
|
+
}
|
|
4022
|
+
return _isEnabled;
|
|
4023
|
+
});
|
|
4024
|
+
useEffect15(() => {
|
|
4025
|
+
if (registerLocalZone) {
|
|
4026
|
+
registerLocalZone(zoneCompound, targetAccepted || isEnabled);
|
|
4027
|
+
}
|
|
4028
|
+
return () => {
|
|
4029
|
+
if (unregisterLocalZone) {
|
|
4030
|
+
unregisterLocalZone(zoneCompound);
|
|
4063
4031
|
}
|
|
4064
4032
|
};
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4033
|
+
}, [targetAccepted, isEnabled, zoneCompound]);
|
|
4034
|
+
const [contentIdsWithPreview, preview] = useContentIdsWithPreview(
|
|
4035
|
+
contentIds,
|
|
4036
|
+
zoneCompound
|
|
4037
|
+
);
|
|
4038
|
+
const isDropEnabled = isEnabled && (preview ? contentIdsWithPreview.length === 1 : contentIdsWithPreview.length === 0);
|
|
4039
|
+
const zoneStore = useContext7(ZoneStoreContext);
|
|
4040
|
+
useEffect15(() => {
|
|
4041
|
+
const { enabledIndex } = zoneStore.getState();
|
|
4042
|
+
zoneStore.setState({
|
|
4043
|
+
enabledIndex: __spreadProps(__spreadValues({}, enabledIndex), { [zoneCompound]: isEnabled })
|
|
4074
4044
|
});
|
|
4045
|
+
}, [isEnabled, zoneStore, zoneCompound]);
|
|
4046
|
+
const droppableConfig = {
|
|
4047
|
+
id: zoneCompound,
|
|
4048
|
+
collisionPriority: isEnabled ? depth : 0,
|
|
4049
|
+
disabled: !isDropEnabled,
|
|
4050
|
+
collisionDetector: pointerIntersection,
|
|
4051
|
+
type: "dropzone",
|
|
4052
|
+
data: {
|
|
4053
|
+
areaId,
|
|
4054
|
+
depth,
|
|
4055
|
+
isDroppableTarget: targetAccepted,
|
|
4056
|
+
path: path || []
|
|
4057
|
+
}
|
|
4058
|
+
};
|
|
4059
|
+
const ref = useRef7(null);
|
|
4060
|
+
const { ref: dropRef } = useDroppable(droppableConfig);
|
|
4061
|
+
const isAreaSelected = useAppStore(
|
|
4062
|
+
(s) => (s == null ? void 0 : s.selectedItem) && areaId === (s == null ? void 0 : s.selectedItem.props.id)
|
|
4063
|
+
);
|
|
4064
|
+
const [dragAxis] = useDragAxis(ref, collisionAxis);
|
|
4065
|
+
const [minEmptyHeight, isAnimating] = useMinEmptyHeight({
|
|
4066
|
+
zoneCompound,
|
|
4067
|
+
userMinEmptyHeight,
|
|
4068
|
+
ref
|
|
4069
|
+
});
|
|
4070
|
+
useEffect15(() => {
|
|
4071
|
+
if (ref.current) {
|
|
4072
|
+
dropRef(ref.current);
|
|
4073
|
+
const classesToRemove = [
|
|
4074
|
+
getClassName16(),
|
|
4075
|
+
getClassName16({ isRootZone: true }, { excludeBase: true }),
|
|
4076
|
+
getClassName16({ hoveringOverArea: true }, { excludeBase: true }),
|
|
4077
|
+
getClassName16({ isEnabled: true }, { excludeBase: true }),
|
|
4078
|
+
getClassName16({ isAreaSelected: true }, { excludeBase: true }),
|
|
4079
|
+
getClassName16({ hasChildren: true }, { excludeBase: true }),
|
|
4080
|
+
getClassName16({ isAnimating: true }, { excludeBase: true })
|
|
4081
|
+
].filter((c) => c);
|
|
4082
|
+
ref.current.classList.remove(...classesToRemove);
|
|
4083
|
+
const classesToAdd = [
|
|
4084
|
+
getClassName16(),
|
|
4085
|
+
getClassName16({ isRootZone }, { excludeBase: true }),
|
|
4086
|
+
getClassName16({ hoveringOverArea }, { excludeBase: true }),
|
|
4087
|
+
getClassName16({ isEnabled }, { excludeBase: true }),
|
|
4088
|
+
getClassName16({ isAreaSelected }, { excludeBase: true }),
|
|
4089
|
+
getClassName16(
|
|
4090
|
+
{ hasChildren: contentIds.length > 0 },
|
|
4091
|
+
{ excludeBase: true }
|
|
4092
|
+
),
|
|
4093
|
+
getClassName16({ isAnimating }, { excludeBase: true })
|
|
4094
|
+
].filter((c) => c);
|
|
4095
|
+
ref.current.classList.add(...classesToAdd);
|
|
4096
|
+
ref.current.setAttribute("data-testid", `dropzone:${zoneCompound}`);
|
|
4097
|
+
ref.current.setAttribute("data-puck-dropzone", zoneCompound);
|
|
4098
|
+
if (typeof minEmptyHeight !== "undefined") {
|
|
4099
|
+
ref.current.style.setProperty(
|
|
4100
|
+
"--min-empty-height",
|
|
4101
|
+
typeof minEmptyHeight === "number" ? `${minEmptyHeight}px` : minEmptyHeight
|
|
4102
|
+
);
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
}, [
|
|
4106
|
+
ref,
|
|
4107
|
+
isRootZone,
|
|
4108
|
+
hoveringOverArea,
|
|
4109
|
+
isEnabled,
|
|
4110
|
+
isAreaSelected,
|
|
4111
|
+
contentIds.length,
|
|
4112
|
+
isAnimating,
|
|
4113
|
+
zoneCompound,
|
|
4114
|
+
minEmptyHeight
|
|
4115
|
+
]);
|
|
4116
|
+
return [
|
|
4117
|
+
ref,
|
|
4118
|
+
contentIdsWithPreview.map((componentId, i) => {
|
|
4119
|
+
return /* @__PURE__ */ jsx29(
|
|
4120
|
+
DropZoneChildMemo,
|
|
4121
|
+
{
|
|
4122
|
+
zoneCompound,
|
|
4123
|
+
componentId,
|
|
4124
|
+
dragAxis,
|
|
4125
|
+
index: i,
|
|
4126
|
+
collisionAxis,
|
|
4127
|
+
inDroppableZone: targetAccepted
|
|
4128
|
+
},
|
|
4129
|
+
componentId
|
|
4130
|
+
);
|
|
4131
|
+
})
|
|
4132
|
+
];
|
|
4133
|
+
};
|
|
4134
|
+
var DropZoneEdit = forwardRef(
|
|
4135
|
+
function DropZoneEditInternal(props, userRef) {
|
|
4136
|
+
var _a;
|
|
4137
|
+
const [ref, children] = useSlot(props);
|
|
4075
4138
|
const setRefs = useCallback11(
|
|
4076
4139
|
(node) => {
|
|
4077
|
-
assignRefs([ref,
|
|
4140
|
+
assignRefs([ref, userRef], node);
|
|
4078
4141
|
},
|
|
4079
|
-
[
|
|
4080
|
-
);
|
|
4081
|
-
const El = as != null ? as : "div";
|
|
4082
|
-
return /* @__PURE__ */ jsx29(
|
|
4083
|
-
El,
|
|
4084
|
-
{
|
|
4085
|
-
className: `${getClassName16({
|
|
4086
|
-
isRootZone,
|
|
4087
|
-
hoveringOverArea,
|
|
4088
|
-
isEnabled,
|
|
4089
|
-
isAreaSelected,
|
|
4090
|
-
hasChildren: contentIds.length > 0,
|
|
4091
|
-
isAnimating
|
|
4092
|
-
})}${className ? ` ${className}` : ""}`,
|
|
4093
|
-
ref: setRefs,
|
|
4094
|
-
"data-testid": `dropzone:${zoneCompound}`,
|
|
4095
|
-
"data-puck-dropzone": zoneCompound,
|
|
4096
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
4097
|
-
"--min-empty-height": minEmptyHeight,
|
|
4098
|
-
backgroundColor: RENDER_DEBUG ? getRandomColor() : style == null ? void 0 : style.backgroundColor
|
|
4099
|
-
}),
|
|
4100
|
-
children: contentIdsWithPreview.map((componentId, i) => {
|
|
4101
|
-
return /* @__PURE__ */ jsx29(
|
|
4102
|
-
DropZoneChildMemo,
|
|
4103
|
-
{
|
|
4104
|
-
zoneCompound,
|
|
4105
|
-
componentId,
|
|
4106
|
-
dragAxis,
|
|
4107
|
-
index: i,
|
|
4108
|
-
collisionAxis,
|
|
4109
|
-
inDroppableZone: targetAccepted
|
|
4110
|
-
},
|
|
4111
|
-
componentId
|
|
4112
|
-
);
|
|
4113
|
-
})
|
|
4114
|
-
}
|
|
4142
|
+
[ref, userRef]
|
|
4115
4143
|
);
|
|
4144
|
+
const El = (_a = props.as) != null ? _a : "div";
|
|
4145
|
+
return /* @__PURE__ */ jsx29(El, { ref: setRefs, className: props.className, style: props.style, children });
|
|
4116
4146
|
}
|
|
4117
4147
|
);
|
|
4118
4148
|
var DropZoneRenderItem = ({
|
|
@@ -8034,6 +8064,7 @@ export {
|
|
|
8034
8064
|
Render,
|
|
8035
8065
|
registerOverlayPortal,
|
|
8036
8066
|
setDeep,
|
|
8067
|
+
useSlot,
|
|
8037
8068
|
DropZone,
|
|
8038
8069
|
Drawer,
|
|
8039
8070
|
createUsePuck,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-MDUBGHWF.mjs";
|
|
9
9
|
import {
|
|
10
10
|
get_class_name_factory_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q7WALXIQ.mjs";
|
|
12
12
|
import {
|
|
13
13
|
generateId,
|
|
14
14
|
getZoneId,
|
|
@@ -400,7 +400,7 @@ function useRichtextProps(fields, props) {
|
|
|
400
400
|
const richtextProps = useMemo2(() => {
|
|
401
401
|
if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
|
|
402
402
|
const RichTextRender = lazy(
|
|
403
|
-
() => import("./Render-
|
|
403
|
+
() => import("./Render-I4N6YQDP.mjs").then((m) => ({
|
|
404
404
|
default: m.RichTextRender
|
|
405
405
|
}))
|
|
406
406
|
);
|
|
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
|
|
|
70
70
|
// lib/get-class-name-factory.ts
|
|
71
71
|
init_react_import();
|
|
72
72
|
var import_classnames = __toESM(require_classnames());
|
|
73
|
-
var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
|
|
73
|
+
var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}, params = {}) => {
|
|
74
74
|
if (typeof options === "string") {
|
|
75
75
|
const descendant = options;
|
|
76
76
|
const style = styles[`${rootClass}-${descendant}`];
|
|
@@ -84,7 +84,7 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
|
|
|
84
84
|
for (let modifier in modifiers) {
|
|
85
85
|
prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
|
|
86
86
|
}
|
|
87
|
-
const c = styles[rootClass];
|
|
87
|
+
const c = !params.excludeBase ? styles[rootClass] : "";
|
|
88
88
|
return config.baseClass + (0, import_classnames.default)(__spreadValues({
|
|
89
89
|
[c]: !!c
|
|
90
90
|
}, prefixedModifiers));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q7O6TFQB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useHeadingOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6WA3HRH4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useListOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TGGRMDFQ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
AlignCenter,
|
|
12
12
|
AlignJustify,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
Strikethrough,
|
|
27
27
|
Underline,
|
|
28
28
|
useControlContext
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EH5IVUJL.mjs";
|
|
30
30
|
import {
|
|
31
31
|
get_class_name_factory_default
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-Q7WALXIQ.mjs";
|
|
33
33
|
import {
|
|
34
34
|
__objRest,
|
|
35
35
|
__spreadValues,
|
|
@@ -349,7 +349,7 @@ function AlignSelectFallback() {
|
|
|
349
349
|
// components/RichTextMenu/controls/AlignSelect/index.tsx
|
|
350
350
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
351
351
|
var AlignSelectLoaded = lazy(
|
|
352
|
-
() => import("./loaded-
|
|
352
|
+
() => import("./loaded-CDQ6IGP6.mjs").then((m) => ({
|
|
353
353
|
default: m.AlignSelectLoaded
|
|
354
354
|
}))
|
|
355
355
|
);
|
|
@@ -580,7 +580,7 @@ function HeadingSelectFallback() {
|
|
|
580
580
|
// components/RichTextMenu/controls/HeadingSelect/index.tsx
|
|
581
581
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
582
582
|
var HeadingSelectLoaded = lazy2(
|
|
583
|
-
() => import("./loaded-
|
|
583
|
+
() => import("./loaded-IEPYAJGX.mjs").then((m) => ({
|
|
584
584
|
default: m.HeadingSelectLoaded
|
|
585
585
|
}))
|
|
586
586
|
);
|
|
@@ -612,7 +612,7 @@ function ListSelectFallback() {
|
|
|
612
612
|
// components/RichTextMenu/controls/ListSelect/index.tsx
|
|
613
613
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
614
614
|
var ListSelectLoaded = lazy3(
|
|
615
|
-
() => import("./loaded-
|
|
615
|
+
() => import("./loaded-244PGCK6.mjs").then((m) => ({
|
|
616
616
|
default: m.ListSelectLoaded
|
|
617
617
|
}))
|
|
618
618
|
);
|