@contentful/experiences-visual-editor-react 3.0.0-alpha-20250709T0751-bcbfd82.0 → 3.0.0-alpha-20250801T0844-68b7839.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 +19 -1
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +19 -1
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,17 @@ const propsToRemove = [
|
|
|
1444
1444
|
const sanitizeNodeProps = (nodeProps) => {
|
|
1445
1445
|
return omit(nodeProps, stylesToRemove, propsToRemove);
|
|
1446
1446
|
};
|
|
1447
|
+
|
|
1448
|
+
/** Turn the visibility value into a style object that can be used for inline styles in React */
|
|
1449
|
+
const transformVisibility = (value) => {
|
|
1450
|
+
if (value === false) {
|
|
1451
|
+
return {
|
|
1452
|
+
display: 'none !important',
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
// Don't explicitly set anything when visible to not overwrite values like `grid` or `flex`.
|
|
1456
|
+
return {};
|
|
1457
|
+
};
|
|
1447
1458
|
const transformGridColumn = (span) => {
|
|
1448
1459
|
if (!span) {
|
|
1449
1460
|
return {};
|
|
@@ -4691,7 +4702,12 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
4691
4702
|
entityStore,
|
|
4692
4703
|
findNodeById,
|
|
4693
4704
|
]);
|
|
4694
|
-
const cfStyles = useMemo(() =>
|
|
4705
|
+
const cfStyles = useMemo(() => ({
|
|
4706
|
+
...buildCfStyles(props),
|
|
4707
|
+
// The visibility needs to be transformed separately as it requires
|
|
4708
|
+
// a special handling for preview & SSR rendering (not here though).
|
|
4709
|
+
...transformVisibility(props.cfVisibility),
|
|
4710
|
+
}), [props]);
|
|
4695
4711
|
const shouldRenderEmptySpaceWithMinSize = useMemo(() => {
|
|
4696
4712
|
if (node.children.length)
|
|
4697
4713
|
return false;
|
|
@@ -4884,6 +4900,8 @@ const useCanvasGeometryUpdates = ({ tree }) => {
|
|
|
4884
4900
|
// Handling DOM mutations
|
|
4885
4901
|
useEffect(() => {
|
|
4886
4902
|
const observer = new MutationObserver(() => debouncedUpdateGeometry(treeRef.current, 'mutation'));
|
|
4903
|
+
// send initial geometry in case the tree is empty
|
|
4904
|
+
debouncedUpdateGeometry(treeRef.current, 'mutation');
|
|
4887
4905
|
observer.observe(document.documentElement, {
|
|
4888
4906
|
childList: true,
|
|
4889
4907
|
subtree: true,
|