@contentful/experiences-visual-editor-react 1.1.0 → 1.2.0-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 +13 -4
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +13 -4
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/renderApp.js
CHANGED
|
@@ -38819,7 +38819,7 @@ const optionalBuiltInStyles = {
|
|
|
38819
38819
|
},
|
|
38820
38820
|
};
|
|
38821
38821
|
|
|
38822
|
-
|
|
38822
|
+
let designTokensRegistry = {};
|
|
38823
38823
|
/**
|
|
38824
38824
|
* Register design tokens styling
|
|
38825
38825
|
* @param designTokenDefinition - {[key:string]: Record<string, string>}
|
|
@@ -50807,11 +50807,16 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
50807
50807
|
const dataSource = useEditorStore((state) => state.dataSource);
|
|
50808
50808
|
const entityStore = useEntityStore((state) => state.entityStore);
|
|
50809
50809
|
const props = reactExports.useMemo(() => {
|
|
50810
|
+
const propsBase = node.data.props?.cfSsrClassName
|
|
50811
|
+
? {
|
|
50812
|
+
cfSsrClassName: resolveDesignValue(node.data.props.cfSsrClassName.valuesByBreakpoint, 'cfSsrClassName'),
|
|
50813
|
+
}
|
|
50814
|
+
: {};
|
|
50810
50815
|
// Don't enrich the assembly wrapper node with props
|
|
50811
50816
|
if (!definition || node.type === ASSEMBLY_NODE_TYPE) {
|
|
50812
|
-
return
|
|
50817
|
+
return propsBase;
|
|
50813
50818
|
}
|
|
50814
|
-
|
|
50819
|
+
const extractedProps = Object.entries(definition.variables).reduce((acc, [variableName, variableDefinition]) => {
|
|
50815
50820
|
const variableMapping = node.data.props[variableName];
|
|
50816
50821
|
if (!variableMapping) {
|
|
50817
50822
|
return {
|
|
@@ -50886,6 +50891,10 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
50886
50891
|
return { ...acc };
|
|
50887
50892
|
}
|
|
50888
50893
|
}, {});
|
|
50894
|
+
return {
|
|
50895
|
+
...propsBase,
|
|
50896
|
+
...extractedProps,
|
|
50897
|
+
};
|
|
50889
50898
|
}, [
|
|
50890
50899
|
hyperlinkPattern,
|
|
50891
50900
|
node,
|
|
@@ -50947,7 +50956,7 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
50947
50956
|
const stylesToKeep = ['cfImageAsset'];
|
|
50948
50957
|
const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
|
|
50949
50958
|
const componentProps = {
|
|
50950
|
-
className: componentClass,
|
|
50959
|
+
className: props.cfSsrClassName ?? componentClass,
|
|
50951
50960
|
editorMode: true,
|
|
50952
50961
|
node,
|
|
50953
50962
|
renderDropzone,
|