@plumeria/unplugin 11.1.2 → 11.1.3

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/dist/core.js CHANGED
@@ -869,11 +869,17 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
869
869
  const uniqueKey = `${resourcePath}-${node.id.value}`;
870
870
  scannedTables.createThemeHashTable[uniqueKey] = hash;
871
871
  scannedTables.createThemeObjectTable[hash] = obj;
872
+ mergedCreateThemeHashTable[node.id.value] = hash;
873
+ const themeHashMap = {};
874
+ for (const [key] of Object.entries(obj)) {
875
+ const cssVarName = (0, zss_engine_1.camelToKebabCase)(key);
876
+ themeHashMap[key] = `var(--${hash}-${cssVarName})`;
877
+ }
872
878
  localCreateStyles[node.id.value] = {
873
879
  name: node.id.value,
874
880
  type: 'constant',
875
881
  obj,
876
- hashMap: scannedTables.createAtomicMapTable[hash],
882
+ hashMap: themeHashMap,
877
883
  isExported,
878
884
  initSpan: {
879
885
  start: init.span.start - baseByteOffset,
package/dist/core.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createFilter } from '@rollup/pluginutils';
2
2
  import { parseSync } from '@swc/core';
3
3
  import * as path from 'path';
4
- import { applyCssValue, genBase36Hash, exceptionCamelCase } from 'zss-engine';
4
+ import { applyCssValue, genBase36Hash, exceptionCamelCase, camelToKebabCase, } from 'zss-engine';
5
5
  import { traverse, getStyleRecords, collectLocalConsts, objectExpressionToObject, t, extractOndemandStyles, deepMerge, scanAll, resolveImportPath, processVariants, getLeadingCommentLength, optimizer, } from '@plumeria/utils';
6
6
  export const TARGET_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx'];
7
7
  export const EXTENSION_PATTERN = /\.(ts|tsx|js|jsx)$/;
@@ -833,11 +833,17 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
833
833
  const uniqueKey = `${resourcePath}-${node.id.value}`;
834
834
  scannedTables.createThemeHashTable[uniqueKey] = hash;
835
835
  scannedTables.createThemeObjectTable[hash] = obj;
836
+ mergedCreateThemeHashTable[node.id.value] = hash;
837
+ const themeHashMap = {};
838
+ for (const [key] of Object.entries(obj)) {
839
+ const cssVarName = camelToKebabCase(key);
840
+ themeHashMap[key] = `var(--${hash}-${cssVarName})`;
841
+ }
836
842
  localCreateStyles[node.id.value] = {
837
843
  name: node.id.value,
838
844
  type: 'constant',
839
845
  obj,
840
- hashMap: scannedTables.createAtomicMapTable[hash],
846
+ hashMap: themeHashMap,
841
847
  isExported,
842
848
  initSpan: {
843
849
  start: init.span.start - baseByteOffset,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/unplugin",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
4
4
  "description": "Universal Plumeria plugin for various build tools",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -86,7 +86,7 @@
86
86
  ],
87
87
  "dependencies": {
88
88
  "unplugin": "^3.0.0",
89
- "@plumeria/utils": "^11.1.2"
89
+ "@plumeria/utils": "^11.1.3"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@swc/core": "1.15.21",