@contentful/experiences-core 1.13.0-dev-20240904T1154-0746e97.0 → 1.13.0-dev-20240905T1100-bae32ba.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 +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2419,7 +2419,7 @@ const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpoint
|
|
|
2419
2419
|
if (valuesByBreakpoint instanceof Object) {
|
|
2420
2420
|
// Assume that the values are sorted by media query to apply the cascading CSS logic
|
|
2421
2421
|
for (let index = activeBreakpointIndex; index >= 0; index--) {
|
|
2422
|
-
const breakpointId = breakpoints[index]
|
|
2422
|
+
const breakpointId = breakpoints[index]?.id;
|
|
2423
2423
|
if (valuesByBreakpoint[breakpointId]) {
|
|
2424
2424
|
// If the value is defined, we use it and stop the breakpoints cascade
|
|
2425
2425
|
return eventuallyResolveDesignTokens(valuesByBreakpoint[breakpointId]);
|
|
@@ -2427,8 +2427,10 @@ const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpoint
|
|
|
2427
2427
|
}
|
|
2428
2428
|
// If no breakpoint matched, we search and apply the fallback breakpoint
|
|
2429
2429
|
const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);
|
|
2430
|
-
const fallbackBreakpointId = breakpoints[fallbackBreakpointIndex]
|
|
2431
|
-
|
|
2430
|
+
const fallbackBreakpointId = breakpoints[fallbackBreakpointIndex]?.id;
|
|
2431
|
+
if (valuesByBreakpoint[fallbackBreakpointId]) {
|
|
2432
|
+
return eventuallyResolveDesignTokens(valuesByBreakpoint[fallbackBreakpointId]);
|
|
2433
|
+
}
|
|
2432
2434
|
}
|
|
2433
2435
|
else {
|
|
2434
2436
|
// Old design properties did not support breakpoints, keep for backward compatibility
|