@contentful/experiences-visual-editor-react 1.11.1 → 1.11.2-dev-20240724T1634-dd1094a.0
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/index.js +8 -17
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +8 -17
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3616,13 +3616,13 @@ const getUnboundValues = ({ key, fallback, unboundValues, }) => {
|
|
|
3616
3616
|
return get$1(unboundValues, lodashPath, fallback);
|
|
3617
3617
|
};
|
|
3618
3618
|
|
|
3619
|
-
const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, renderDropzone, definition, userIsDragging,
|
|
3619
|
+
const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, renderDropzone, definition, userIsDragging, }) => {
|
|
3620
3620
|
const unboundValues = useEditorStore((state) => state.unboundValues);
|
|
3621
3621
|
const hyperlinkPattern = useEditorStore((state) => state.hyperLinkPattern);
|
|
3622
3622
|
const locale = useEditorStore((state) => state.locale);
|
|
3623
3623
|
const dataSource = useEditorStore((state) => state.dataSource);
|
|
3624
3624
|
const entityStore = useEntityStore((state) => state.entityStore);
|
|
3625
|
-
const isEmptyZone = !node.children.
|
|
3625
|
+
const isEmptyZone = !node.children.length;
|
|
3626
3626
|
const props = useMemo(() => {
|
|
3627
3627
|
const propsBase = {
|
|
3628
3628
|
cfSsrClassName: node.data.props.cfSsrClassName
|
|
@@ -3943,7 +3943,7 @@ const MissingComponentPlacehoder = ({ blockId }) => {
|
|
|
3943
3943
|
"'"));
|
|
3944
3944
|
};
|
|
3945
3945
|
|
|
3946
|
-
const useComponent = ({ node: rawNode, resolveDesignValue, renderDropzone, userIsDragging,
|
|
3946
|
+
const useComponent = ({ node: rawNode, resolveDesignValue, renderDropzone, userIsDragging, }) => {
|
|
3947
3947
|
const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);
|
|
3948
3948
|
const entityStore = useEntityStore((state) => state.entityStore);
|
|
3949
3949
|
const node = useMemo(() => {
|
|
@@ -3977,7 +3977,6 @@ const useComponent = ({ node: rawNode, resolveDesignValue, renderDropzone, userI
|
|
|
3977
3977
|
renderDropzone,
|
|
3978
3978
|
definition: componentRegistration?.definition,
|
|
3979
3979
|
userIsDragging,
|
|
3980
|
-
slotId,
|
|
3981
3980
|
});
|
|
3982
3981
|
const elementToRender = (props) => {
|
|
3983
3982
|
if (!componentRegistration) {
|
|
@@ -4067,12 +4066,8 @@ const calcNewComponentStyles = (params) => {
|
|
|
4067
4066
|
const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);
|
|
4068
4067
|
const width = isHorizontal ? DRAGGABLE_WIDTH : dropzoneSizes.width - horizontalPadding;
|
|
4069
4068
|
const height = isHorizontal ? dropzoneSizes.height - verticalPadding : DRAGGABLE_HEIGHT;
|
|
4070
|
-
const top = isHorizontal
|
|
4071
|
-
|
|
4072
|
-
: -height;
|
|
4073
|
-
const left = isHorizontal
|
|
4074
|
-
? -width
|
|
4075
|
-
: calcOffsetLeft(element.parentElement, width, elementSizes.width);
|
|
4069
|
+
const top = isHorizontal ? calcOffsetTop(element, height, elementSizes.height) : -height;
|
|
4070
|
+
const left = isHorizontal ? -width : calcOffsetLeft(element, width, elementSizes.width);
|
|
4076
4071
|
return {
|
|
4077
4072
|
width,
|
|
4078
4073
|
height,
|
|
@@ -4106,12 +4101,8 @@ const calcMovementStyles = (params) => {
|
|
|
4106
4101
|
const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);
|
|
4107
4102
|
const width = isHorizontal ? draggableSizes.width : dropzoneSizes.width - horizontalPadding;
|
|
4108
4103
|
const height = isHorizontal ? dropzoneSizes.height - verticalPadding : draggableSizes.height;
|
|
4109
|
-
const top = isHorizontal
|
|
4110
|
-
|
|
4111
|
-
: -height;
|
|
4112
|
-
const left = isHorizontal
|
|
4113
|
-
? -width
|
|
4114
|
-
: calcOffsetLeft(element.parentElement, width, elementSizes.width);
|
|
4104
|
+
const top = isHorizontal ? calcOffsetTop(element, height, elementSizes.height) : -height;
|
|
4105
|
+
const left = isHorizontal ? -width : calcOffsetLeft(element, width, elementSizes.width);
|
|
4115
4106
|
return {
|
|
4116
4107
|
width,
|
|
4117
4108
|
height,
|
|
@@ -4156,6 +4147,7 @@ const Placeholder = (props) => {
|
|
|
4156
4147
|
}),
|
|
4157
4148
|
backgroundColor: 'rgba(var(--exp-builder-blue300-rgb), 0.5)',
|
|
4158
4149
|
position: 'absolute',
|
|
4150
|
+
pointerEvents: 'none',
|
|
4159
4151
|
} })));
|
|
4160
4152
|
};
|
|
4161
4153
|
|
|
@@ -4452,7 +4444,6 @@ const EditorBlock = ({ node: rawNode, resolveDesignValue, renderDropzone, index,
|
|
|
4452
4444
|
resolveDesignValue,
|
|
4453
4445
|
renderDropzone,
|
|
4454
4446
|
userIsDragging,
|
|
4455
|
-
slotId,
|
|
4456
4447
|
});
|
|
4457
4448
|
const { isSingleColumn, isWrapped } = useSingleColumn(node, resolveDesignValue);
|
|
4458
4449
|
const setDomRect = useDraggedItemStore((state) => state.setDomRect);
|