@plumeria/unplugin 18.3.2 → 18.3.4
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 +3 -3
- package/dist/core.mjs +4 -4
- package/package.json +2 -2
package/dist/core.js
CHANGED
|
@@ -627,7 +627,7 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
627
627
|
throwCompilationError(`Plumeria: Unsupported at-rule: "${selector}". createTheme only supports nesting at-rules such as @media, @container, @supports, @layer, and @scope.`, selectorExpr);
|
|
628
628
|
}
|
|
629
629
|
const obj = (0, utils_1.objectExpressionToObject)(init.arguments[1].expression, mergedStaticTable, mergedKeyframesTable, mergedViewTransitionTable, mergedCreateThemeHashTable, scannedTables.createThemeObjectTable, mergedCreateTable, mergedCreateStaticHashTable, scannedTables.createStaticObjectTable, mergedVariantsTable);
|
|
630
|
-
const hash = (0,
|
|
630
|
+
const hash = (0, utils_1.themeHashOf)(selector, obj);
|
|
631
631
|
if (utils_1.t.isIdentifier(node.id)) {
|
|
632
632
|
const uniqueKey = `${resourcePath}-${node.id.value}`;
|
|
633
633
|
scannedTables.createThemeHashTable[uniqueKey] = hash;
|
|
@@ -639,7 +639,7 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
639
639
|
const themeHashMap = {};
|
|
640
640
|
for (const [key, value] of Object.entries(obj)) {
|
|
641
641
|
const cssVarName = (0, zss_engine_1.camelToKebabCase)(key);
|
|
642
|
-
const atomicHash = (0, zss_engine_1.genBase36Hash)({ [key]: value }, 1, 8);
|
|
642
|
+
const atomicHash = (0, zss_engine_1.genBase36Hash)({ _theme: hash, [key]: value }, 1, 8);
|
|
643
643
|
themeHashMap[key] = `var(--${atomicHash}-${cssVarName})`;
|
|
644
644
|
}
|
|
645
645
|
localCreateStyles[node.id.value] = {
|
|
@@ -809,7 +809,7 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
809
809
|
throwCompilationError(`Plumeria: Unsupported at-rule: "${selector}". createTheme only supports nesting at-rules such as @media, @container, @supports, @layer, and @scope.`, selectorExpr);
|
|
810
810
|
}
|
|
811
811
|
const obj = (0, utils_1.objectExpressionToObject)(args[1].expression, mergedStaticTable, mergedKeyframesTable, mergedViewTransitionTable, mergedCreateThemeHashTable, scannedTables.createThemeObjectTable, mergedCreateTable, mergedCreateStaticHashTable, scannedTables.createStaticObjectTable, mergedVariantsTable);
|
|
812
|
-
const hash = (0,
|
|
812
|
+
const hash = (0, utils_1.themeHashOf)(selector, obj);
|
|
813
813
|
scannedTables.createThemeObjectTable[hash] = obj;
|
|
814
814
|
if (scannedTables.createThemeSelectorTable) {
|
|
815
815
|
scannedTables.createThemeSelectorTable[hash] = selector;
|
package/dist/core.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createFilter } from '@rollup/pluginutils';
|
|
|
2
2
|
import { parseSync } from '@swc/core';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { applyCssValue, genBase36Hash, exceptionCamelCase, camelToKebabCase, isAtRule, } from 'zss-engine';
|
|
5
|
-
import { traverse, collectReferenceIdentifiers, getStyleRecords, getStateWeights, collectLocalConsts, objectExpressionToObject, t, getRootIdentifier, extractOndemandStyles, deepMerge, scanAll, resolveImportPath, getLeadingCommentLength, optimizer, getFileDependencies, resolveExport, resolveComponentKey, DEFAULT_STYLE_PROP, } from '@plumeria/utils';
|
|
5
|
+
import { traverse, collectReferenceIdentifiers, getStyleRecords, getStateWeights, collectLocalConsts, objectExpressionToObject, t, getRootIdentifier, extractOndemandStyles, deepMerge, scanAll, resolveImportPath, getLeadingCommentLength, optimizer, themeHashOf, getFileDependencies, resolveExport, resolveComponentKey, DEFAULT_STYLE_PROP, } from '@plumeria/utils';
|
|
6
6
|
export const TARGET_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx'];
|
|
7
7
|
export const EXTENSION_PATTERN = /\.(ts|tsx|js|jsx)$/;
|
|
8
8
|
const isStaticArgValue = (node) => node.type === 'StringLiteral' ||
|
|
@@ -591,7 +591,7 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
591
591
|
throwCompilationError(`Plumeria: Unsupported at-rule: "${selector}". createTheme only supports nesting at-rules such as @media, @container, @supports, @layer, and @scope.`, selectorExpr);
|
|
592
592
|
}
|
|
593
593
|
const obj = objectExpressionToObject(init.arguments[1].expression, mergedStaticTable, mergedKeyframesTable, mergedViewTransitionTable, mergedCreateThemeHashTable, scannedTables.createThemeObjectTable, mergedCreateTable, mergedCreateStaticHashTable, scannedTables.createStaticObjectTable, mergedVariantsTable);
|
|
594
|
-
const hash =
|
|
594
|
+
const hash = themeHashOf(selector, obj);
|
|
595
595
|
if (t.isIdentifier(node.id)) {
|
|
596
596
|
const uniqueKey = `${resourcePath}-${node.id.value}`;
|
|
597
597
|
scannedTables.createThemeHashTable[uniqueKey] = hash;
|
|
@@ -603,7 +603,7 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
603
603
|
const themeHashMap = {};
|
|
604
604
|
for (const [key, value] of Object.entries(obj)) {
|
|
605
605
|
const cssVarName = camelToKebabCase(key);
|
|
606
|
-
const atomicHash = genBase36Hash({ [key]: value }, 1, 8);
|
|
606
|
+
const atomicHash = genBase36Hash({ _theme: hash, [key]: value }, 1, 8);
|
|
607
607
|
themeHashMap[key] = `var(--${atomicHash}-${cssVarName})`;
|
|
608
608
|
}
|
|
609
609
|
localCreateStyles[node.id.value] = {
|
|
@@ -773,7 +773,7 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
773
773
|
throwCompilationError(`Plumeria: Unsupported at-rule: "${selector}". createTheme only supports nesting at-rules such as @media, @container, @supports, @layer, and @scope.`, selectorExpr);
|
|
774
774
|
}
|
|
775
775
|
const obj = objectExpressionToObject(args[1].expression, mergedStaticTable, mergedKeyframesTable, mergedViewTransitionTable, mergedCreateThemeHashTable, scannedTables.createThemeObjectTable, mergedCreateTable, mergedCreateStaticHashTable, scannedTables.createStaticObjectTable, mergedVariantsTable);
|
|
776
|
-
const hash =
|
|
776
|
+
const hash = themeHashOf(selector, obj);
|
|
777
777
|
scannedTables.createThemeObjectTable[hash] = obj;
|
|
778
778
|
if (scannedTables.createThemeSelectorTable) {
|
|
779
779
|
scannedTables.createThemeSelectorTable[hash] = selector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/unplugin",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.4",
|
|
4
4
|
"description": "Universal Plumeria plugin for various build tools",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"@rollup/pluginutils": "^5.4.0",
|
|
96
96
|
"unplugin": "^3.0.0",
|
|
97
|
-
"@plumeria/utils": "^18.3.
|
|
97
|
+
"@plumeria/utils": "^18.3.4"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"@swc/core": "1.15.47",
|