@contentful/experiences-core 1.19.1-dev-20241016T1823-1386004.0 → 1.19.1-dev-20241021T1606-f345cd0.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 +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1063,16 +1063,19 @@ const ensureValidCompositeValues = (designTokenDefinition) => {
|
|
|
1063
1063
|
const defineDesignTokens = (designTokenDefinition) => {
|
|
1064
1064
|
Object.assign(designTokensRegistry, ensureValidCompositeValues(designTokenDefinition));
|
|
1065
1065
|
};
|
|
1066
|
-
const templateStringRegex = /\${(.+?)}/g;
|
|
1066
|
+
const templateStringRegex = /\${(\w.+?)}/g;
|
|
1067
1067
|
const getDesignTokenRegistration = (breakpointValue, variableName) => {
|
|
1068
1068
|
if (!breakpointValue)
|
|
1069
1069
|
return breakpointValue;
|
|
1070
1070
|
let resolvedValue = '';
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1071
|
+
// Match all parts of the string, including design tokens and other parts
|
|
1072
|
+
const parts = breakpointValue.match(/(\${.+?}|\S+)/g);
|
|
1073
|
+
if (parts) {
|
|
1074
|
+
for (const part of parts) {
|
|
1075
|
+
const isDesignToken = templateStringRegex.test(part);
|
|
1076
|
+
const tokenValue = isDesignToken ? resolveSimpleDesignToken(part, variableName) : part;
|
|
1077
|
+
resolvedValue += `${tokenValue} `;
|
|
1078
|
+
}
|
|
1076
1079
|
}
|
|
1077
1080
|
// Not trimming would end up with a trailing space that breaks the check in `calculateNodeDefaultHeight`
|
|
1078
1081
|
return resolvedValue.trim();
|