@contentful/experiences-core 1.19.1-dev-20241014T1637-45fad70.0 → 1.19.1-dev-20241017T2042-ba9cebd.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 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
- for (const part of breakpointValue.split(' ')) {
1072
- const tokenValue = templateStringRegex.test(part)
1073
- ? resolveSimpleDesignToken(part, variableName)
1074
- : part;
1075
- resolvedValue += `${tokenValue} `;
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();