@plumeria/compiler 11.0.1 → 11.1.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.
Files changed (2) hide show
  1. package/dist/index.js +9 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -491,18 +491,22 @@ function compileCSS(options) {
491
491
  if (styleInfo && styleInfo.functions?.[propName]) {
492
492
  const func = styleInfo.functions[propName];
493
493
  const callArgs = expr.arguments;
494
- if (callArgs.length === 1 && !callArgs[0].spread) {
495
- const argExpr = callArgs[0].expression;
494
+ const hasSpread = callArgs.some((a) => a.spread);
495
+ if (!hasSpread && callArgs.length >= 1) {
496
496
  const tempStaticTable = { ...ctx.mergedStaticTable };
497
- if (argExpr.type === 'ObjectExpression') {
498
- const argObj = (0, utils_1.objectExpressionToObject)(argExpr, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
497
+ if (callArgs.length === 1 &&
498
+ callArgs[0].expression.type === 'ObjectExpression') {
499
+ const argObj = (0, utils_1.objectExpressionToObject)(callArgs[0].expression, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
499
500
  func.params.forEach((p) => {
500
501
  if (argObj[p] !== undefined)
501
502
  tempStaticTable[p] = argObj[p];
502
503
  });
503
504
  }
504
505
  else {
505
- func.params.forEach((p) => {
506
+ callArgs.forEach((_callArg, i) => {
507
+ const p = func.params[i];
508
+ if (!p)
509
+ return;
506
510
  tempStaticTable[p] = `var(--${propName}-${p})`;
507
511
  });
508
512
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/compiler",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Plumeria swc based compiler for statically extracting css",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dist/"
22
22
  ],
23
23
  "dependencies": {
24
- "@plumeria/utils": "^11.0.1"
24
+ "@plumeria/utils": "^11.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@rust-gear/glob": "1.0.0",