@plumeria/compiler 12.0.1 → 12.0.2

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 +17 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -579,6 +579,13 @@ function compileCSS(options) {
579
579
  const hash = (0, zss_engine_1.genBase36Hash)(obj, 1, 8);
580
580
  ctx.scannedTables.createThemeObjectTable[hash] = obj;
581
581
  }
582
+ else if (propName === 'createStatic' &&
583
+ args.length > 0 &&
584
+ utils_1.t.isObjectExpression(args[0].expression)) {
585
+ const obj = (0, utils_1.objectExpressionToObject)(args[0].expression, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
586
+ const hash = (0, zss_engine_1.genBase36Hash)(obj, 1, 8);
587
+ ctx.scannedTables.createStaticObjectTable[hash] = obj;
588
+ }
582
589
  }
583
590
  };
584
591
  const traverseInternal = (node) => {
@@ -682,6 +689,16 @@ function compileCSS(options) {
682
689
  obj: ctx.scannedTables.createAtomicMapTable[hash],
683
690
  };
684
691
  }
692
+ else if (pName === 'createStatic') {
693
+ const obj = (0, utils_1.objectExpressionToObject)(arg, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
694
+ if (obj) {
695
+ const hash = (0, zss_engine_1.genBase36Hash)(obj, 1, 8);
696
+ const uKey = `${resourcePath}-${node.id.value}`;
697
+ ctx.scannedTables.createStaticHashTable[uKey] = hash;
698
+ ctx.scannedTables.createStaticObjectTable[hash] = obj;
699
+ ctx.mergedCreateStaticHashTable[node.id.value] = hash;
700
+ }
701
+ }
685
702
  }
686
703
  }
687
704
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/compiler",
3
- "version": "12.0.1",
3
+ "version": "12.0.2",
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": "^12.0.1"
24
+ "@plumeria/utils": "^12.0.2"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@rust-gear/glob": "1.0.0",