@contentful/experiences-visual-editor-react 3.6.0-dev-20250903T1157-8aba2a4.0 → 3.6.1-beta.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 -7
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +19 -7
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -10
package/dist/renderApp.js
CHANGED
|
@@ -48672,7 +48672,7 @@ function getSchemaWithNodeType(nodeType) {
|
|
|
48672
48672
|
|
|
48673
48673
|
} (dist));
|
|
48674
48674
|
|
|
48675
|
-
var css_248z$8 = "
|
|
48675
|
+
var css_248z$8 = ":root{--cf-color-white:#fff;--cf-color-black:#000;--cf-color-gray100:#f7f9fa;--cf-color-gray400:#aec1cc;--cf-color-gray400-rgb:174,193,204;--cf-spacing-0:0rem;--cf-spacing-1:0.125rem;--cf-spacing-2:0.25rem;--cf-spacing-3:0.375rem;--cf-spacing-4:0.5rem;--cf-spacing-5:0.625rem;--cf-spacing-6:0.75rem;--cf-spacing-7:0.875rem;--cf-spacing-8:1rem;--cf-spacing-9:1.25rem;--cf-spacing-10:1.5rem;--cf-spacing-11:1.75rem;--cf-spacing-12:2rem;--cf-spacing-13:2.25rem;--cf-text-xs:0.75rem;--cf-text-sm:0.875rem;--cf-text-base:1rem;--cf-text-lg:1.125rem;--cf-text-xl:1.25rem;--cf-text-2xl:1.5rem;--cf-text-3xl:2rem;--cf-text-4xl:2.75rem;--cf-font-light:300;--cf-font-normal:400;--cf-font-medium:500;--cf-font-semibold:600;--cf-font-bold:700;--cf-font-extra-bold:800;--cf-font-black:900;--cf-border-radius-none:0px;--cf-border-radius-sm:0.125rem;--cf-border-radius:0.25rem;--cf-border-radius-md:0.375rem;--cf-border-radius-lg:0.5rem;--cf-border-radius-xl:0.75rem;--cf-border-radius-2xl:1rem;--cf-border-radius-3xl:1.5rem;--cf-border-radius-full:9999px;--cf-max-width-full:100%;--cf-button-bg:var(--cf-color-black);--cf-button-color:var(--cf-color-white);--cf-text-color:var(--cf-color-black)}*{box-sizing:border-box}";
|
|
48676
48676
|
styleInject(css_248z$8);
|
|
48677
48677
|
|
|
48678
48678
|
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
@@ -50152,6 +50152,15 @@ const maybeMergePatternDefaultDesignValues = ({ variableName, variableMapping, n
|
|
|
50152
50152
|
return variableMapping.valuesByBreakpoint;
|
|
50153
50153
|
};
|
|
50154
50154
|
|
|
50155
|
+
const checkIsNodeVisible = (node, resolveDesignValue) => {
|
|
50156
|
+
if (node.type === ASSEMBLY_NODE_TYPE || node.type === ROOT_ID) {
|
|
50157
|
+
// If this is a wrapping pattern/root with no visible children, it is invisible as well
|
|
50158
|
+
return node.children.some((childNode) => checkIsNodeVisible(childNode, resolveDesignValue));
|
|
50159
|
+
}
|
|
50160
|
+
// Check if the current node is visible (`cfVisibility` is enforced on all nodes)
|
|
50161
|
+
return !!resolveDesignValue(node.data.props['cfVisibility'].valuesByBreakpoint);
|
|
50162
|
+
};
|
|
50163
|
+
|
|
50155
50164
|
const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesignValue, definition, options, }) => {
|
|
50156
50165
|
const unboundValues = useEditorStore((state) => state.unboundValues);
|
|
50157
50166
|
const hyperlinkPattern = useEditorStore((state) => state.hyperLinkPattern);
|
|
@@ -50292,7 +50301,8 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
50292
50301
|
...transformVisibility(props.cfVisibility),
|
|
50293
50302
|
}), [props]);
|
|
50294
50303
|
const shouldRenderEmptySpaceWithMinSize = reactExports.useMemo(() => {
|
|
50295
|
-
|
|
50304
|
+
const isAnyChildrenVisible = node.children.some((childNode) => checkIsNodeVisible(childNode, resolveDesignValue));
|
|
50305
|
+
if (isAnyChildrenVisible)
|
|
50296
50306
|
return false;
|
|
50297
50307
|
// Render with minimum height and with in those two scenarios:
|
|
50298
50308
|
if (isStructureWithRelativeHeight(node.data.blockId, cfStyles.height))
|
|
@@ -50300,7 +50310,7 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
50300
50310
|
if (definition?.children)
|
|
50301
50311
|
return true;
|
|
50302
50312
|
return false;
|
|
50303
|
-
}, [cfStyles.height, definition?.children, node.children
|
|
50313
|
+
}, [cfStyles.height, definition?.children, node.children, node.data.blockId, resolveDesignValue]);
|
|
50304
50314
|
// Styles that will be applied to the component element
|
|
50305
50315
|
const componentStyles = reactExports.useMemo(() => ({
|
|
50306
50316
|
...cfStyles,
|
|
@@ -50321,7 +50331,8 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
50321
50331
|
editorProps.isEditorMode = true;
|
|
50322
50332
|
}
|
|
50323
50333
|
if (options?.enableEditorProperties?.isEmpty) {
|
|
50324
|
-
|
|
50334
|
+
const areAllChildrenHidden = node.children.every((childNode) => !checkIsNodeVisible(childNode, resolveDesignValue));
|
|
50335
|
+
editorProps.isEmpty = node.children.length === 0 || areAllChildrenHidden;
|
|
50325
50336
|
}
|
|
50326
50337
|
if (options?.enableEditorProperties?.nodeBlockId) {
|
|
50327
50338
|
editorProps.nodeBlockId = node.data.blockId;
|
|
@@ -50331,12 +50342,12 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
50331
50342
|
}
|
|
50332
50343
|
return editorProps;
|
|
50333
50344
|
}, [
|
|
50334
|
-
node.children.length,
|
|
50335
|
-
node.data.blockId,
|
|
50336
50345
|
options?.enableEditorProperties?.isEditorMode,
|
|
50337
50346
|
options?.enableEditorProperties?.isEmpty,
|
|
50338
50347
|
options?.enableEditorProperties?.nodeBlockId,
|
|
50339
50348
|
options?.enableCustomEditorView,
|
|
50349
|
+
node,
|
|
50350
|
+
resolveDesignValue,
|
|
50340
50351
|
]);
|
|
50341
50352
|
const componentProps = reactExports.useMemo(() => {
|
|
50342
50353
|
const sharedProps = {
|
|
@@ -50608,7 +50619,8 @@ const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
|
50608
50619
|
const wrappingPatternIds = rootBlockId !== ROOT_ID ? new Set([rootBlockId]) : new Set();
|
|
50609
50620
|
const entityStore = inMemoryEntitiesStore((state) => state.entityStore);
|
|
50610
50621
|
const areEntitiesFetched = inMemoryEntitiesStore((state) => state.areEntitiesFetched);
|
|
50611
|
-
|
|
50622
|
+
const isAnyNodeVisible = checkIsNodeVisible(tree.root, resolveDesignValue);
|
|
50623
|
+
return (React$1.createElement(React$1.Fragment, null, !isAnyNodeVisible ? (React$1.createElement(EmptyCanvasMessage, null)) : (tree.root.children.map((topLevelChildNode) => (React$1.createElement(EditorBlock, { key: topLevelChildNode.data.id, node: topLevelChildNode, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, entityStore: entityStore, areEntitiesFetched: areEntitiesFetched }))))));
|
|
50612
50624
|
};
|
|
50613
50625
|
|
|
50614
50626
|
const useInitializeEditor = (inMemoryEntitiesStore) => {
|