@contentful/experiences-visual-editor-react 1.37.1-dev-20250514T1115-cc6f809.0 → 1.37.1-dev-20250515T1211-cc16b86.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 +1 -78
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +1 -78
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/renderApp.js
CHANGED
|
@@ -43684,21 +43684,6 @@ const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpoint
|
|
|
43684
43684
|
return valuesByBreakpoint;
|
|
43685
43685
|
}
|
|
43686
43686
|
};
|
|
43687
|
-
/** Overwrites the default value breakpoint by breakpoint. If a breakpoint
|
|
43688
|
-
* is not overwritten, it will fall back to the default. */
|
|
43689
|
-
const mergeDesignValuesByBreakpoint = (defaultValue, overwriteValue) => {
|
|
43690
|
-
const mergedValuesByBreakpoint = { ...defaultValue.valuesByBreakpoint };
|
|
43691
|
-
for (const [breakpointId, value] of Object.entries(overwriteValue.valuesByBreakpoint)) {
|
|
43692
|
-
if (!isValidBreakpointValue(value)) {
|
|
43693
|
-
continue;
|
|
43694
|
-
}
|
|
43695
|
-
mergedValuesByBreakpoint[breakpointId] = value;
|
|
43696
|
-
}
|
|
43697
|
-
return {
|
|
43698
|
-
type: 'DesignValue',
|
|
43699
|
-
valuesByBreakpoint: mergedValuesByBreakpoint,
|
|
43700
|
-
};
|
|
43701
|
-
};
|
|
43702
43687
|
|
|
43703
43688
|
const CF_DEBUG_KEY$1 = 'cf_debug';
|
|
43704
43689
|
let DebugLogger$1 = class DebugLogger {
|
|
@@ -56762,26 +56747,6 @@ const useTreeStore = create$1((set, get) => ({
|
|
|
56762
56747
|
reparentChildNode(sourceIndex, destinationIndex, sourceParentId, destinationParentId, state.tree.root);
|
|
56763
56748
|
}));
|
|
56764
56749
|
},
|
|
56765
|
-
// breadth first search
|
|
56766
|
-
findNodeById(nodeId) {
|
|
56767
|
-
if (!nodeId) {
|
|
56768
|
-
return null;
|
|
56769
|
-
}
|
|
56770
|
-
const rootNode = get().tree.root;
|
|
56771
|
-
const visitedNodeIds = [];
|
|
56772
|
-
const queue = [];
|
|
56773
|
-
let currentNode = rootNode;
|
|
56774
|
-
queue.push(currentNode);
|
|
56775
|
-
while (queue.length) {
|
|
56776
|
-
currentNode = queue.shift();
|
|
56777
|
-
visitedNodeIds.push(currentNode.data.id);
|
|
56778
|
-
if (currentNode.data.id === nodeId) {
|
|
56779
|
-
return currentNode;
|
|
56780
|
-
}
|
|
56781
|
-
queue.push(...currentNode.children);
|
|
56782
|
-
}
|
|
56783
|
-
return null;
|
|
56784
|
-
},
|
|
56785
56750
|
}));
|
|
56786
56751
|
const hasBreakpointDiffs = (currentTree, newTree) => {
|
|
56787
56752
|
const currentBreakpoints = currentTree?.root?.data?.breakpoints ?? [];
|
|
@@ -56932,8 +56897,6 @@ const useEditorStore = create$1((set, get) => ({
|
|
|
56932
56897
|
dataSource: {},
|
|
56933
56898
|
hyperLinkPattern: undefined,
|
|
56934
56899
|
unboundValues: {},
|
|
56935
|
-
isDragging: false,
|
|
56936
|
-
dragItem: '',
|
|
56937
56900
|
selectedNodeId: null,
|
|
56938
56901
|
locale: null,
|
|
56939
56902
|
setHyperLinkPattern: (pattern) => {
|
|
@@ -59608,38 +59571,6 @@ const getUnboundValues = ({ key, fallback, unboundValues, }) => {
|
|
|
59608
59571
|
return get$1(unboundValues, lodashPath, fallback);
|
|
59609
59572
|
};
|
|
59610
59573
|
|
|
59611
|
-
/**
|
|
59612
|
-
* When node is a pattern block, we need to look up for default values of the pattern variables
|
|
59613
|
-
* and merge them with the updated node props.
|
|
59614
|
-
* While loop is making sure that we look up for the updated default values in the parent pattern
|
|
59615
|
-
* component settings as well.
|
|
59616
|
-
*/
|
|
59617
|
-
const maybeMergePatternDefaultDesignValues = ({ variableName, variableMapping, node, findNodeById, }) => {
|
|
59618
|
-
if (node.type === ASSEMBLY_BLOCK_NODE_TYPE) {
|
|
59619
|
-
const patternId = node.data.pattern?.id;
|
|
59620
|
-
const exposedPropertyName = node['exposedPropertyNameToKeyMap'][variableName];
|
|
59621
|
-
if (!exposedPropertyName || !patternId) {
|
|
59622
|
-
return variableMapping.valuesByBreakpoint;
|
|
59623
|
-
}
|
|
59624
|
-
const exposedVariableDefinition = componentRegistry.get(patternId)?.definition.variables[exposedPropertyName];
|
|
59625
|
-
let exposedDefaultValue = exposedVariableDefinition?.defaultValue;
|
|
59626
|
-
let parentPatternNode = findNodeById(node.data.pattern?.nodeId);
|
|
59627
|
-
while (parentPatternNode) {
|
|
59628
|
-
const parentPatternId = parentPatternNode.data.pattern?.id;
|
|
59629
|
-
const nextKey = parentPatternNode['exposedPropertyNameToKeyMap'][exposedPropertyName];
|
|
59630
|
-
if (!parentPatternId || !nextKey) {
|
|
59631
|
-
break;
|
|
59632
|
-
}
|
|
59633
|
-
const parentPatternVariableDefinition = componentRegistry.get(parentPatternId)?.definition.variables[nextKey];
|
|
59634
|
-
exposedDefaultValue = mergeDesignValuesByBreakpoint(parentPatternVariableDefinition?.defaultValue, exposedDefaultValue);
|
|
59635
|
-
parentPatternNode = findNodeById(parentPatternNode.data.pattern?.nodeId);
|
|
59636
|
-
}
|
|
59637
|
-
const mergedDesignValue = mergeDesignValuesByBreakpoint(exposedDefaultValue, variableMapping);
|
|
59638
|
-
return mergedDesignValue.valuesByBreakpoint;
|
|
59639
|
-
}
|
|
59640
|
-
return variableMapping.valuesByBreakpoint;
|
|
59641
|
-
};
|
|
59642
|
-
|
|
59643
59574
|
const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, renderDropzone, definition, options, userIsDragging, requiresDragWrapper, }) => {
|
|
59644
59575
|
const unboundValues = useEditorStore((state) => state.unboundValues);
|
|
59645
59576
|
const hyperlinkPattern = useEditorStore((state) => state.hyperLinkPattern);
|
|
@@ -59648,7 +59579,6 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
59648
59579
|
const entityStore = useEntityStore((state) => state.entityStore);
|
|
59649
59580
|
const draggingId = useDraggedItemStore((state) => state.onBeforeCaptureId);
|
|
59650
59581
|
const nodeRect = useDraggedItemStore((state) => state.domRect);
|
|
59651
|
-
const findNodeById = useTreeStore((state) => state.findNodeById);
|
|
59652
59582
|
const isEmptyZone = !node.children.length;
|
|
59653
59583
|
const props = reactExports.useMemo(() => {
|
|
59654
59584
|
const propsBase = {
|
|
@@ -59672,13 +59602,7 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
59672
59602
|
};
|
|
59673
59603
|
}
|
|
59674
59604
|
if (variableMapping.type === 'DesignValue') {
|
|
59675
|
-
const
|
|
59676
|
-
variableName,
|
|
59677
|
-
variableMapping,
|
|
59678
|
-
node,
|
|
59679
|
-
findNodeById,
|
|
59680
|
-
});
|
|
59681
|
-
const valuesByBreakpoint = resolveDesignValue(value, variableName);
|
|
59605
|
+
const valuesByBreakpoint = resolveDesignValue(variableMapping.valuesByBreakpoint, variableName);
|
|
59682
59606
|
const designValue = variableName === 'cfHeight'
|
|
59683
59607
|
? calculateNodeDefaultHeight({
|
|
59684
59608
|
blockId: node.data.blockId,
|
|
@@ -59769,7 +59693,6 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
59769
59693
|
unboundValues,
|
|
59770
59694
|
entityStore,
|
|
59771
59695
|
renderDropzone,
|
|
59772
|
-
findNodeById,
|
|
59773
59696
|
]);
|
|
59774
59697
|
const cfStyles = reactExports.useMemo(() => buildCfStyles(props), [props]);
|
|
59775
59698
|
const cfVisibility = props['cfVisibility'];
|