@contentstack/studio-registry 1.1.2 → 1.2.1

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.
@@ -4996,12 +4996,20 @@ function getDefaultGlobalDesignTokens() {
4996
4996
 
4997
4997
  class DesignRegistry {
4998
4998
  classes = {};
4999
- tokens = getDefaultDesignTokens();
5000
- cssVariables = {};
4999
+ tokens;
5000
+ cssVariables;
5001
5001
  options = {
5002
5002
  tokenOptions: getDefaultDesignTokensOptions(),
5003
5003
  };
5004
- cssVariablesToDesignTokens = {};
5004
+ cssVariablesToDesignTokens;
5005
+ constructor() {
5006
+ // Initialize with DEFAULT_DESIGN_TOKENS
5007
+ const csDesignTokens = processDesignToken(DEFAULT_DESIGN_TOKENS);
5008
+ const { processedDesignTokens, cssVariablesValues, cssVariablesToDesignTokens, } = designTokensToCssVariables(csDesignTokens);
5009
+ this.tokens = processedDesignTokens;
5010
+ this.cssVariables = cssVariablesValues;
5011
+ this.cssVariablesToDesignTokens = cssVariablesToDesignTokens;
5012
+ }
5005
5013
  registerDesignTokens(tokens, options = {}) {
5006
5014
  const csDesignTokens = processDesignToken(DEFAULT_DESIGN_TOKENS);
5007
5015
  const userDesignTokens = processDesignToken(tokens);
@@ -5451,6 +5459,27 @@ function retrievePropValue(args) {
5451
5459
  }
5452
5460
  else if (dataPath) {
5453
5461
  resolvedData = get(data, dataPath, fallbackValue);
5462
+ // Handle primitive values in repeater context
5463
+ // When the array contains primitives (strings, numbers, etc.) instead of objects,
5464
+ // the binding path will be like: dataSources.repeater.{uid}.context.{fieldName}
5465
+ // But context IS the primitive value, so accessing context.fieldName returns undefined.
5466
+ // In this case, we should return the context itself.
5467
+ if (dataPath.includes("dataSources.repeater")) {
5468
+ const pathParts = dataPath.split(".");
5469
+ // Check if path is: dataSources.repeater.{uid}.context.{fieldName}
5470
+ if (pathParts.length >= 5 && pathParts[3] === "context") {
5471
+ // Try to get just the context (without the field name)
5472
+ const contextPath = pathParts.slice(0, 4).join("."); // dataSources.repeater.{uid}.context
5473
+ const contextValue = get(data, contextPath);
5474
+ // If context exists and is a primitive (not an object/array), return it
5475
+ if (contextValue !== undefined && contextValue !== null) {
5476
+ const isPrimitive = typeof contextValue !== "object" || contextValue === null;
5477
+ if (isPrimitive) {
5478
+ resolvedData = contextValue;
5479
+ }
5480
+ }
5481
+ }
5482
+ }
5454
5483
  if (type === "choice") {
5455
5484
  if (!prop.multiSelect) {
5456
5485
  // we are explicitly checking for single select choice type to ensure we don't have a mismatch in the data type.