@contentful/experiences-core 3.8.4-beta.0 → 3.8.4-beta.2
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/cjs/index.cjs +9 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -2691,6 +2691,10 @@ const detachExperienceStyles = (experience) => {
|
|
|
2691
2691
|
// conflicts between different breakpoint values from multiple nodes where the hash would be equal
|
|
2692
2692
|
// - Adding wrapping pattern nodes IDs to avoid conflicts between similar nested patterns as those
|
|
2693
2693
|
// could override each others CSS for some breakpoints just through the order of `<style>` tags in the DOM.
|
|
2694
|
+
// - We're only considering the regular CSS (not the visibility-specific one) but that doesn't cause an issue
|
|
2695
|
+
// since we already use the breakpointId (which is not used in CSR, see createStylesheetsForBuiltInStyles).
|
|
2696
|
+
// Theoretically, we could drop `generatedCss` from the hash generation and still be safe from conflicts (unless
|
|
2697
|
+
// the node IDs are similar but visibility is different?)
|
|
2694
2698
|
const styleHash = md5(currentNodeIdsChain + breakpointId + generatedCss);
|
|
2695
2699
|
// and prefix the className to make sure the value can be processed
|
|
2696
2700
|
const className = `cf-${styleHash}`;
|
|
@@ -2923,6 +2927,11 @@ const resolveBackgroundImageBinding = ({ variableData, getBoundEntityById, dataS
|
|
|
2923
2927
|
// '/lUERH7tX7nJTaPX6f0udB/fields/assetReference/~locale/fields/file/~locale'
|
|
2924
2928
|
const [, uuid] = variableData.path.split('/');
|
|
2925
2929
|
const binding = dataSource[uuid];
|
|
2930
|
+
// Safeguard against edge cases - we should not have bound style values that do not have a data source entry.
|
|
2931
|
+
// However, just in case, we handle it here as empty and allow the user to replace without errors.
|
|
2932
|
+
if (!binding) {
|
|
2933
|
+
return;
|
|
2934
|
+
}
|
|
2926
2935
|
const boundEntity = getBoundEntityById(binding.sys.id);
|
|
2927
2936
|
if (!boundEntity) {
|
|
2928
2937
|
return;
|