@stylexjs/babel-plugin 0.2.0-beta.22 → 0.2.0-beta.23

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.
Files changed (2) hide show
  1. package/lib/index.js +9 -5
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -4437,9 +4437,13 @@ stylex.types = stylex.stylex = void 0;
4437
4437
  var _stylexInject = _interopRequireDefault(stylexInject);
4438
4438
  var _styleq = require$$1;
4439
4439
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4440
- function props(styles, _options) {
4440
+ function props() {
4441
+ const options = this;
4442
+ for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
4443
+ styles[_key] = arguments[_key];
4444
+ }
4441
4445
  if (__implementations.props) {
4442
- return __implementations.props(styles, _options);
4446
+ return __implementations.props.call(options, styles);
4443
4447
  }
4444
4448
  const [className, style] = (0, _styleq.styleq)(styles);
4445
4449
  const result = {};
@@ -4538,8 +4542,8 @@ const firstThatWorks = function () {
4538
4542
  stylex.firstThatWorks = firstThatWorks;
4539
4543
  const inject = stylex.inject = _stylexInject.default;
4540
4544
  function _stylex() {
4541
- for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
4542
- styles[_key] = arguments[_key];
4545
+ for (var _len2 = arguments.length, styles = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
4546
+ styles[_key2] = arguments[_key2];
4543
4547
  }
4544
4548
  const [className] = (0, _styleq.styleq)(styles);
4545
4549
  return className;
@@ -4762,7 +4766,7 @@ function transformStylexProps(path, state) {
4762
4766
  }
4763
4767
  let bailOut = false;
4764
4768
  let conditional = 0;
4765
- const args = node.arguments[0]?.type === 'ArrayExpression' ? node.arguments[0].elements : node.arguments.slice(0, 1);
4769
+ const args = node.arguments.flatMap(arg => arg.type === 'ArrayExpression' ? arg.elements : [arg]);
4766
4770
  const resolvedArgs = [];
4767
4771
  for (const arg of args) {
4768
4772
  switch (arg.type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stylexjs/babel-plugin",
3
- "version": "0.2.0-beta.22",
3
+ "version": "0.2.0-beta.23",
4
4
  "description": "StyleX babel plugin.",
5
5
  "main": "lib/index.js",
6
6
  "repository": "https://github.com/facebook/stylex",
@@ -12,7 +12,7 @@
12
12
  "test": "jest"
13
13
  },
14
14
  "dependencies": {
15
- "@stylexjs/shared": "0.2.0-beta.22"
15
+ "@stylexjs/shared": "0.2.0-beta.23"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "@babel/core": "^7.19.6",