@idealyst/theme 1.2.77 → 1.2.79

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/theme",
3
- "version": "1.2.77",
3
+ "version": "1.2.79",
4
4
  "description": "Theming system for Idealyst Framework",
5
5
  "readme": "README.md",
6
6
  "main": "src/index.ts",
@@ -63,7 +63,7 @@
63
63
  "publish:npm": "npm publish"
64
64
  },
65
65
  "dependencies": {
66
- "@idealyst/tooling": "^1.2.30"
66
+ "@idealyst/tooling": "^1.2.79"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react-native-unistyles": ">=3.0.0"
@@ -730,9 +730,11 @@ function buildMemberExpression(t, base, chain) {
730
730
  // e.g., theme.colors.surface['inverse-secondary'] instead of theme.colors.surface.inverse-secondary
731
731
  const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(part);
732
732
  if (isValidIdentifier) {
733
- expr = t.memberExpression(expr, t.identifier(part));
733
+ // Use optional chaining to avoid crashes when theme values are undefined
734
+ expr = t.optionalMemberExpression(expr, t.identifier(part), false, true);
734
735
  } else {
735
- expr = t.memberExpression(expr, t.stringLiteral(part), true); // computed = true
736
+ // computed = true, optional = true
737
+ expr = t.optionalMemberExpression(expr, t.stringLiteral(part), true, true);
736
738
  }
737
739
  }
738
740
  return expr;