@contentful/experiences-core 1.15.0-beta.0 → 1.15.0-dev-20240911T0845-c2631a9.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 +4 -10
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/utils/breakpoints.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2431,9 +2431,9 @@ const builtInStylesWithDesignTokens = [
|
|
|
2431
2431
|
const isValidBreakpointValue = (value) => {
|
|
2432
2432
|
return value !== undefined && value !== null && value !== '';
|
|
2433
2433
|
};
|
|
2434
|
-
const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpointIndex, variableName
|
|
2434
|
+
const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpointIndex, variableName) => {
|
|
2435
2435
|
const eventuallyResolveDesignTokens = (value) => {
|
|
2436
|
-
// For some built-in design
|
|
2436
|
+
// For some built-in design propertier, we support design tokens
|
|
2437
2437
|
if (builtInStylesWithDesignTokens.includes(variableName)) {
|
|
2438
2438
|
return getDesignTokenRegistration(value, variableName);
|
|
2439
2439
|
}
|
|
@@ -2446,20 +2446,14 @@ const getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpoint
|
|
|
2446
2446
|
const breakpointId = breakpoints[index]?.id;
|
|
2447
2447
|
if (isValidBreakpointValue(valuesByBreakpoint[breakpointId])) {
|
|
2448
2448
|
// If the value is defined, we use it and stop the breakpoints cascade
|
|
2449
|
-
|
|
2450
|
-
return eventuallyResolveDesignTokens(valuesByBreakpoint[breakpointId]);
|
|
2451
|
-
}
|
|
2452
|
-
return valuesByBreakpoint[breakpointId];
|
|
2449
|
+
return eventuallyResolveDesignTokens(valuesByBreakpoint[breakpointId]);
|
|
2453
2450
|
}
|
|
2454
2451
|
}
|
|
2455
2452
|
// If no breakpoint matched, we search and apply the fallback breakpoint
|
|
2456
2453
|
const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);
|
|
2457
2454
|
const fallbackBreakpointId = breakpoints[fallbackBreakpointIndex]?.id;
|
|
2458
2455
|
if (isValidBreakpointValue(valuesByBreakpoint[fallbackBreakpointId])) {
|
|
2459
|
-
|
|
2460
|
-
return eventuallyResolveDesignTokens(valuesByBreakpoint[fallbackBreakpointId]);
|
|
2461
|
-
}
|
|
2462
|
-
return valuesByBreakpoint[fallbackBreakpointId];
|
|
2456
|
+
return eventuallyResolveDesignTokens(valuesByBreakpoint[fallbackBreakpointId]);
|
|
2463
2457
|
}
|
|
2464
2458
|
}
|
|
2465
2459
|
else {
|