tailwind-to-style 3.2.2 → 4.0.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.
- package/README.md +221 -666
- package/dist/animations/index.cjs +9391 -0
- package/dist/animations/index.d.ts +58 -0
- package/dist/animations/index.esm.js +9385 -0
- package/dist/animations/index.esm.js.map +1 -0
- package/dist/className/index.cjs +9080 -0
- package/dist/className/index.esm.js +9075 -0
- package/dist/className/index.esm.js.map +1 -0
- package/dist/core/tws.cjs +136 -114
- package/dist/core/tws.cjs.map +1 -0
- package/dist/core/tws.esm.js +136 -114
- package/dist/core/tws.esm.js.map +1 -1
- package/dist/core/twsx.cjs +2442 -4245
- package/dist/core/twsx.esm.js +2442 -4245
- package/dist/core/twsx.esm.js.map +1 -1
- package/dist/core/twsxVariants.cjs +2470 -4262
- package/dist/core/twsxVariants.esm.js +2470 -4262
- package/dist/core/twsxVariants.esm.js.map +1 -1
- package/dist/cx.cjs +2 -2
- package/dist/cx.cjs.map +1 -0
- package/dist/cx.esm.js +2 -2
- package/dist/index.cjs +5128 -6057
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +993 -1
- package/dist/index.esm.js +5124 -6022
- package/dist/index.esm.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/react/index.cjs +10177 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.ts +69 -0
- package/dist/react/index.esm.js +10173 -0
- package/dist/react/index.esm.js.map +1 -0
- package/dist/styled/index.cjs +9094 -0
- package/dist/styled/index.cjs.map +1 -0
- package/dist/styled/index.d.ts +17 -0
- package/dist/styled/index.esm.js +9087 -0
- package/dist/styled/index.esm.js.map +1 -0
- package/dist/tokens/index.cjs +359 -0
- package/dist/tokens/index.d.ts +33 -0
- package/dist/tokens/index.esm.js +355 -0
- package/dist/tokens/index.esm.js.map +1 -0
- package/dist/utils/index.cjs +313 -297
- package/dist/utils/index.esm.js +313 -297
- package/dist/utils/index.esm.js.map +1 -1
- package/package.json +38 -24
- package/types/animations/index.d.ts +58 -0
- package/types/className/index.d.ts +41 -0
- package/types/index.d.ts +993 -1
- package/types/react/index.d.ts +69 -0
- package/types/tokens/index.d.ts +33 -0
- package/types/v4.d.ts +191 -0
package/dist/core/tws.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tailwind-to-style
|
|
3
|
-
*
|
|
2
|
+
* tailwind-to-style v4.0.0
|
|
3
|
+
* Zero-build runtime Tailwind CSS engine
|
|
4
4
|
*
|
|
5
5
|
* @author Bigetion
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* TailwindCache singleton for managing generated Tailwind CSS
|
|
12
|
-
* Replaces global state with proper encapsulation
|
|
10
|
+
/**
|
|
11
|
+
* TailwindCache singleton for managing generated Tailwind CSS
|
|
12
|
+
* Replaces global state with proper encapsulation
|
|
13
13
|
*/
|
|
14
14
|
class TailwindCache {
|
|
15
15
|
constructor() {
|
|
@@ -18,11 +18,11 @@ class TailwindCache {
|
|
|
18
18
|
this.initialized = false;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Get or generate the CSS object
|
|
23
|
-
* @param {Function} generateFn - Function to generate CSS string
|
|
24
|
-
* @param {Function} convertFn - Function to convert CSS string to object
|
|
25
|
-
* @returns {Object} CSS object lookup
|
|
21
|
+
/**
|
|
22
|
+
* Get or generate the CSS object
|
|
23
|
+
* @param {Function} generateFn - Function to generate CSS string
|
|
24
|
+
* @param {Function} convertFn - Function to convert CSS string to object
|
|
25
|
+
* @returns {Object} CSS object lookup
|
|
26
26
|
*/
|
|
27
27
|
getOrGenerate(generateFn, convertFn) {
|
|
28
28
|
if (!this.initialized) {
|
|
@@ -33,29 +33,29 @@ class TailwindCache {
|
|
|
33
33
|
return this.cssObject;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* Get the CSS string
|
|
36
|
+
/**
|
|
37
|
+
* Get the CSS string
|
|
38
38
|
*/
|
|
39
39
|
getCssString() {
|
|
40
40
|
return this.twString;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* Get the CSS object
|
|
43
|
+
/**
|
|
44
|
+
* Get the CSS object
|
|
45
45
|
*/
|
|
46
46
|
getCssObject() {
|
|
47
47
|
return this.cssObject;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* Check if cache is initialized
|
|
50
|
+
/**
|
|
51
|
+
* Check if cache is initialized
|
|
52
52
|
*/
|
|
53
53
|
isInitialized() {
|
|
54
54
|
return this.initialized;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* Reset the cache (useful for testing)
|
|
57
|
+
/**
|
|
58
|
+
* Reset the cache (useful for testing)
|
|
59
59
|
*/
|
|
60
60
|
reset() {
|
|
61
61
|
this.twString = null;
|
|
@@ -67,9 +67,9 @@ class TailwindCache {
|
|
|
67
67
|
// Singleton instance
|
|
68
68
|
let instance = null;
|
|
69
69
|
|
|
70
|
-
/**
|
|
71
|
-
* Get the TailwindCache singleton instance
|
|
72
|
-
* @returns {TailwindCache} The cache instance
|
|
70
|
+
/**
|
|
71
|
+
* Get the TailwindCache singleton instance
|
|
72
|
+
* @returns {TailwindCache} The cache instance
|
|
73
73
|
*/
|
|
74
74
|
function getTailwindCache() {
|
|
75
75
|
if (!instance) {
|
|
@@ -78,9 +78,9 @@ function getTailwindCache() {
|
|
|
78
78
|
return instance;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
/**
|
|
82
|
-
* Logger class with configurable log levels
|
|
83
|
-
* Prevents console spam in production
|
|
81
|
+
/**
|
|
82
|
+
* Logger class with configurable log levels
|
|
83
|
+
* Prevents console spam in production
|
|
84
84
|
*/
|
|
85
85
|
class Logger {
|
|
86
86
|
constructor() {
|
|
@@ -95,9 +95,9 @@ class Logger {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* Set the log level
|
|
100
|
-
* @param {string} level - One of 'debug', 'info', 'warn', 'error', 'silent'
|
|
98
|
+
/**
|
|
99
|
+
* Set the log level
|
|
100
|
+
* @param {string} level - One of 'debug', 'info', 'warn', 'error', 'silent'
|
|
101
101
|
*/
|
|
102
102
|
setLevel(level) {
|
|
103
103
|
if (this.levels[level] !== undefined) {
|
|
@@ -105,65 +105,65 @@ class Logger {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/**
|
|
109
|
-
* Get current log level
|
|
108
|
+
/**
|
|
109
|
+
* Get current log level
|
|
110
110
|
*/
|
|
111
111
|
getLevel() {
|
|
112
112
|
return this.level;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
/**
|
|
116
|
-
* Check if a message should be logged
|
|
115
|
+
/**
|
|
116
|
+
* Check if a message should be logged
|
|
117
117
|
*/
|
|
118
118
|
shouldLog(level) {
|
|
119
119
|
return this.levels[level] >= this.levels[this.level];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/**
|
|
123
|
-
* Log debug message
|
|
122
|
+
/**
|
|
123
|
+
* Log debug message
|
|
124
124
|
*/
|
|
125
125
|
debug(message) {
|
|
126
126
|
if (this.shouldLog("debug")) {
|
|
127
127
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
128
128
|
args[_key - 1] = arguments[_key];
|
|
129
129
|
}
|
|
130
|
-
console.debug(
|
|
130
|
+
console.debug("[twsx:debug] ".concat(message), ...args);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/**
|
|
135
|
-
* Log info message
|
|
134
|
+
/**
|
|
135
|
+
* Log info message
|
|
136
136
|
*/
|
|
137
137
|
info(message) {
|
|
138
138
|
if (this.shouldLog("info")) {
|
|
139
139
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
140
140
|
args[_key2 - 1] = arguments[_key2];
|
|
141
141
|
}
|
|
142
|
-
console.info(
|
|
142
|
+
console.info("[twsx:info] ".concat(message), ...args);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
/**
|
|
147
|
-
* Log warning message
|
|
146
|
+
/**
|
|
147
|
+
* Log warning message
|
|
148
148
|
*/
|
|
149
149
|
warn(message) {
|
|
150
150
|
if (this.shouldLog("warn")) {
|
|
151
151
|
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
152
152
|
args[_key3 - 1] = arguments[_key3];
|
|
153
153
|
}
|
|
154
|
-
console.warn(
|
|
154
|
+
console.warn("[twsx:warn] ".concat(message), ...args);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
/**
|
|
159
|
-
* Log error message
|
|
158
|
+
/**
|
|
159
|
+
* Log error message
|
|
160
160
|
*/
|
|
161
161
|
error(message) {
|
|
162
162
|
if (this.shouldLog("error")) {
|
|
163
163
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
164
164
|
args[_key4 - 1] = arguments[_key4];
|
|
165
165
|
}
|
|
166
|
-
console.error(
|
|
166
|
+
console.error("[twsx:error] ".concat(message), ...args);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -177,14 +177,14 @@ try {
|
|
|
177
177
|
// e.g., TWSX_LOG_LEVEL=debug or TWSX_LOG_LEVEL=warn
|
|
178
178
|
logLevel = process.env.TWSX_LOG_LEVEL || "silent";
|
|
179
179
|
}
|
|
180
|
-
} catch {
|
|
180
|
+
} catch (_unused) {
|
|
181
181
|
// Silently fail - in browser environment, default to silent
|
|
182
182
|
logLevel = "silent";
|
|
183
183
|
}
|
|
184
184
|
const logger = new Logger(logLevel);
|
|
185
185
|
|
|
186
|
-
/**
|
|
187
|
-
* Custom error class for tailwind-to-style
|
|
186
|
+
/**
|
|
187
|
+
* Custom error class for tailwind-to-style
|
|
188
188
|
*/
|
|
189
189
|
class TwsError extends Error {
|
|
190
190
|
constructor(message) {
|
|
@@ -196,15 +196,15 @@ class TwsError extends Error {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
/**
|
|
200
|
-
* Error event handlers
|
|
199
|
+
/**
|
|
200
|
+
* Error event handlers
|
|
201
201
|
*/
|
|
202
202
|
const errorHandlers = new Set();
|
|
203
203
|
|
|
204
|
-
/**
|
|
205
|
-
* Handle and broadcast errors
|
|
206
|
-
* @param {Error} error - The error that occurred
|
|
207
|
-
* @param {Object} context - Additional context about the error
|
|
204
|
+
/**
|
|
205
|
+
* Handle and broadcast errors
|
|
206
|
+
* @param {Error} error - The error that occurred
|
|
207
|
+
* @param {Object} context - Additional context about the error
|
|
208
208
|
*/
|
|
209
209
|
function handleError(error) {
|
|
210
210
|
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -263,7 +263,7 @@ const performanceMonitor = {
|
|
|
263
263
|
const duration = performance.now() - marker.startTime;
|
|
264
264
|
if (duration > 5) {
|
|
265
265
|
// Only log if > 5ms
|
|
266
|
-
logger.warn(
|
|
266
|
+
logger.warn("Slow ".concat(marker.label, ": ").concat(duration.toFixed(2), "ms"));
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
269
|
/**
|
|
@@ -286,9 +286,53 @@ const performanceMonitor = {
|
|
|
286
286
|
}
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
function _defineProperty(e, r, t) {
|
|
290
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
291
|
+
value: t,
|
|
292
|
+
enumerable: true,
|
|
293
|
+
configurable: true,
|
|
294
|
+
writable: true
|
|
295
|
+
}) : e[r] = t, e;
|
|
296
|
+
}
|
|
297
|
+
function ownKeys(e, r) {
|
|
298
|
+
var t = Object.keys(e);
|
|
299
|
+
if (Object.getOwnPropertySymbols) {
|
|
300
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
301
|
+
r && (o = o.filter(function (r) {
|
|
302
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
303
|
+
})), t.push.apply(t, o);
|
|
304
|
+
}
|
|
305
|
+
return t;
|
|
306
|
+
}
|
|
307
|
+
function _objectSpread2(e) {
|
|
308
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
309
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
310
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
311
|
+
_defineProperty(e, r, t[r]);
|
|
312
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
313
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return e;
|
|
317
|
+
}
|
|
318
|
+
function _toPrimitive(t, r) {
|
|
319
|
+
if ("object" != typeof t || !t) return t;
|
|
320
|
+
var e = t[Symbol.toPrimitive];
|
|
321
|
+
if (void 0 !== e) {
|
|
322
|
+
var i = e.call(t, r);
|
|
323
|
+
if ("object" != typeof i) return i;
|
|
324
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
325
|
+
}
|
|
326
|
+
return ("string" === r ? String : Number)(t);
|
|
327
|
+
}
|
|
328
|
+
function _toPropertyKey(t) {
|
|
329
|
+
var i = _toPrimitive(t, "string");
|
|
330
|
+
return "symbol" == typeof i ? i : i + "";
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Proper LRU (Least Recently Used) Cache implementation
|
|
335
|
+
* Efficiently manages memory by removing least recently used items
|
|
292
336
|
*/
|
|
293
337
|
class LRUCache {
|
|
294
338
|
constructor() {
|
|
@@ -297,9 +341,9 @@ class LRUCache {
|
|
|
297
341
|
this.cache = new Map();
|
|
298
342
|
}
|
|
299
343
|
|
|
300
|
-
/**
|
|
301
|
-
* Get value from cache
|
|
302
|
-
* Updates the item as most recently used
|
|
344
|
+
/**
|
|
345
|
+
* Get value from cache
|
|
346
|
+
* Updates the item as most recently used
|
|
303
347
|
*/
|
|
304
348
|
get(key) {
|
|
305
349
|
if (!this.cache.has(key)) {
|
|
@@ -312,9 +356,9 @@ class LRUCache {
|
|
|
312
356
|
return value;
|
|
313
357
|
}
|
|
314
358
|
|
|
315
|
-
/**
|
|
316
|
-
* Set value in cache
|
|
317
|
-
* Removes least recently used item if cache is full
|
|
359
|
+
/**
|
|
360
|
+
* Set value in cache
|
|
361
|
+
* Removes least recently used item if cache is full
|
|
318
362
|
*/
|
|
319
363
|
set(key, value) {
|
|
320
364
|
// If key exists, delete it first to update position
|
|
@@ -328,29 +372,29 @@ class LRUCache {
|
|
|
328
372
|
this.cache.set(key, value);
|
|
329
373
|
}
|
|
330
374
|
|
|
331
|
-
/**
|
|
332
|
-
* Check if key exists in cache
|
|
375
|
+
/**
|
|
376
|
+
* Check if key exists in cache
|
|
333
377
|
*/
|
|
334
378
|
has(key) {
|
|
335
379
|
return this.cache.has(key);
|
|
336
380
|
}
|
|
337
381
|
|
|
338
|
-
/**
|
|
339
|
-
* Clear all cache entries
|
|
382
|
+
/**
|
|
383
|
+
* Clear all cache entries
|
|
340
384
|
*/
|
|
341
385
|
clear() {
|
|
342
386
|
this.cache.clear();
|
|
343
387
|
}
|
|
344
388
|
|
|
345
|
-
/**
|
|
346
|
-
* Get current cache size
|
|
389
|
+
/**
|
|
390
|
+
* Get current cache size
|
|
347
391
|
*/
|
|
348
392
|
get size() {
|
|
349
393
|
return this.cache.size;
|
|
350
394
|
}
|
|
351
395
|
|
|
352
|
-
/**
|
|
353
|
-
* Delete specific key
|
|
396
|
+
/**
|
|
397
|
+
* Delete specific key
|
|
354
398
|
*/
|
|
355
399
|
delete(key) {
|
|
356
400
|
return this.cache.delete(key);
|
|
@@ -428,11 +472,11 @@ const COLOR_REGEX_PATTERNS = new Map();
|
|
|
428
472
|
for (const prop of COLOR_PROPERTIES) {
|
|
429
473
|
const escapedProp = prop.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
430
474
|
COLOR_REGEX_PATTERNS.set(prop, {
|
|
431
|
-
rgb: new RegExp(
|
|
432
|
-
rgba: new RegExp(
|
|
433
|
-
hsl: new RegExp(
|
|
434
|
-
hsla: new RegExp(
|
|
435
|
-
hex: new RegExp(
|
|
475
|
+
rgb: new RegExp("(".concat(escapedProp, "\\s*:\\s*)rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)"), "gi"),
|
|
476
|
+
rgba: new RegExp("(".concat(escapedProp, "\\s*:\\s*)rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)"), "gi"),
|
|
477
|
+
hsl: new RegExp("(".concat(escapedProp, "\\s*:\\s*)hsl\\((\\d+),\\s*([\\d.]+%),\\s*([\\d.]+%)\\)"), "gi"),
|
|
478
|
+
hsla: new RegExp("(".concat(escapedProp, "\\s*:\\s*)hsla\\((\\d+),\\s*([\\d.]+%),\\s*([\\d.]+%),\\s*[\\d.]+\\)"), "gi"),
|
|
479
|
+
hex: new RegExp("(".concat(escapedProp, "\\s*:\\s*)(#[0-9a-fA-F]{3,6})"), "gi")
|
|
436
480
|
});
|
|
437
481
|
}
|
|
438
482
|
|
|
@@ -446,16 +490,6 @@ const FRACTION_DENOMINATORS = [2, 3, 4, 5, 6, 12];
|
|
|
446
490
|
/** Prefixes that support fractional values */
|
|
447
491
|
const FRACTION_PREFIXES = ["w-", "h-", "max-w-", "max-h-", "min-w-", "min-h-", "top-", "bottom-", "left-", "right-", "inset-", "inset-x-", "inset-y-", "translate-x-", "translate-y-", "rounded-t-", "rounded-b-", "rounded-l-", "rounded-r-", "rounded-bl-", "rounded-br-", "rounded-tl-", "rounded-tr-", "flex-basis-", "z-"];
|
|
448
492
|
|
|
449
|
-
/**
|
|
450
|
-
* CSS Resolution Utilities
|
|
451
|
-
*
|
|
452
|
-
* Handles CSS custom property (var) resolution, CSS declaration parsing,
|
|
453
|
-
* and conversion between different CSS formats.
|
|
454
|
-
*
|
|
455
|
-
* @module css/resolver
|
|
456
|
-
*/
|
|
457
|
-
|
|
458
|
-
|
|
459
493
|
// Cache for CSS resolution
|
|
460
494
|
const cssResolutionCache = new LRUCache(1000);
|
|
461
495
|
|
|
@@ -510,11 +544,11 @@ function resolveCssToClearCss(cssString) {
|
|
|
510
544
|
const varKeys = Object.keys(customVars);
|
|
511
545
|
for (let i = 0; i < varKeys.length; i++) {
|
|
512
546
|
const key = varKeys[i];
|
|
513
|
-
result +=
|
|
547
|
+
result += "".concat(key, ": ").concat(customVars[key], "; ");
|
|
514
548
|
}
|
|
515
549
|
for (let i = 0; i < propKeys.length; i++) {
|
|
516
550
|
const key = propKeys[i];
|
|
517
|
-
result +=
|
|
551
|
+
result += "".concat(key, ": ").concat(props[key], "; ");
|
|
518
552
|
}
|
|
519
553
|
return result.trim();
|
|
520
554
|
}
|
|
@@ -565,9 +599,7 @@ function separateAndResolveCSS(arr) {
|
|
|
565
599
|
logger.warn("Error processing CSS declaration:", item, error);
|
|
566
600
|
}
|
|
567
601
|
}
|
|
568
|
-
const resolvedProperties = {
|
|
569
|
-
...cssProperties
|
|
570
|
-
};
|
|
602
|
+
const resolvedProperties = _objectSpread2({}, cssProperties);
|
|
571
603
|
|
|
572
604
|
/**
|
|
573
605
|
* Optimized CSS variable resolution using regex-based approach
|
|
@@ -641,7 +673,7 @@ function separateAndResolveCSS(arr) {
|
|
|
641
673
|
const finalKeys = Object.keys(resolvedProperties);
|
|
642
674
|
for (let i = 0; i < finalKeys.length; i++) {
|
|
643
675
|
const key = finalKeys[i];
|
|
644
|
-
result +=
|
|
676
|
+
result += "".concat(key, ": ").concat(resolvedProperties[key], "; ");
|
|
645
677
|
}
|
|
646
678
|
result = result.trim();
|
|
647
679
|
cssResolutionCache.set(cacheKey, result);
|
|
@@ -709,16 +741,6 @@ function inlineStyleToJson(styleString) {
|
|
|
709
741
|
return styleObject;
|
|
710
742
|
}
|
|
711
743
|
|
|
712
|
-
/**
|
|
713
|
-
* CSS Parser Utilities
|
|
714
|
-
*
|
|
715
|
-
* Handles parsing of Tailwind class names, opacity modifiers,
|
|
716
|
-
* bracket value encoding/decoding, and custom value extraction.
|
|
717
|
-
*
|
|
718
|
-
* @module css/parser
|
|
719
|
-
*/
|
|
720
|
-
|
|
721
|
-
|
|
722
744
|
/**
|
|
723
745
|
* Process opacity modifier from class name
|
|
724
746
|
*
|
|
@@ -747,7 +769,7 @@ function processOpacityModifier(className, cssDeclaration) {
|
|
|
747
769
|
for (const prop in OPACITY_PROP_REGEXES) {
|
|
748
770
|
const regex = OPACITY_PROP_REGEXES[prop];
|
|
749
771
|
regex.lastIndex = 0; // Reset global regex
|
|
750
|
-
modifiedDeclaration = modifiedDeclaration.replace(regex,
|
|
772
|
+
modifiedDeclaration = modifiedDeclaration.replace(regex, "".concat(prop, ": ").concat(alphaValue));
|
|
751
773
|
}
|
|
752
774
|
|
|
753
775
|
// Also handle direct color values using pre-compiled regex patterns
|
|
@@ -763,16 +785,16 @@ function processOpacityModifier(className, cssDeclaration) {
|
|
|
763
785
|
patterns.hex.lastIndex = 0;
|
|
764
786
|
|
|
765
787
|
// Convert rgb to rgba with opacity
|
|
766
|
-
modifiedDeclaration = modifiedDeclaration.replace(patterns.rgb,
|
|
788
|
+
modifiedDeclaration = modifiedDeclaration.replace(patterns.rgb, "$1rgba($2, $3, $4, ".concat(alphaValue, ")"));
|
|
767
789
|
|
|
768
790
|
// Update existing rgba opacity
|
|
769
|
-
modifiedDeclaration = modifiedDeclaration.replace(patterns.rgba,
|
|
791
|
+
modifiedDeclaration = modifiedDeclaration.replace(patterns.rgba, "$1rgba($2, $3, $4, ".concat(alphaValue, ")"));
|
|
770
792
|
|
|
771
793
|
// Convert hsl to hsla with opacity
|
|
772
|
-
modifiedDeclaration = modifiedDeclaration.replace(patterns.hsl,
|
|
794
|
+
modifiedDeclaration = modifiedDeclaration.replace(patterns.hsl, "$1hsla($2, $3, $4, ".concat(alphaValue, ")"));
|
|
773
795
|
|
|
774
796
|
// Update existing hsla opacity
|
|
775
|
-
modifiedDeclaration = modifiedDeclaration.replace(patterns.hsla,
|
|
797
|
+
modifiedDeclaration = modifiedDeclaration.replace(patterns.hsla, "$1hsla($2, $3, $4, ".concat(alphaValue, ")"));
|
|
776
798
|
|
|
777
799
|
// Handle hex colors - convert to rgba
|
|
778
800
|
modifiedDeclaration = modifiedDeclaration.replace(patterns.hex, (match, propPart, hexColor) => {
|
|
@@ -788,7 +810,7 @@ function processOpacityModifier(className, cssDeclaration) {
|
|
|
788
810
|
g = parseInt(hex.substring(2, 4), 16);
|
|
789
811
|
b = parseInt(hex.substring(4, 6), 16);
|
|
790
812
|
}
|
|
791
|
-
return
|
|
813
|
+
return "".concat(propPart, "rgba(").concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alphaValue, ")");
|
|
792
814
|
});
|
|
793
815
|
}
|
|
794
816
|
return modifiedDeclaration;
|
|
@@ -863,12 +885,12 @@ function tws(classNames) {
|
|
|
863
885
|
|
|
864
886
|
// If no valid classes are found
|
|
865
887
|
if (!classes || classes.length === 0) {
|
|
866
|
-
logger.warn(
|
|
888
|
+
logger.warn("No valid Tailwind classes found in input: \"".concat(classNames, "\""));
|
|
867
889
|
performanceMonitor.end(totalMarker);
|
|
868
890
|
return convertToJson ? {} : "";
|
|
869
891
|
}
|
|
870
892
|
} catch (error) {
|
|
871
|
-
logger.error(
|
|
893
|
+
logger.error("Error parsing Tailwind classes: ".concat(error.message));
|
|
872
894
|
performanceMonitor.end(totalMarker);
|
|
873
895
|
return convertToJson ? {} : "";
|
|
874
896
|
}
|
|
@@ -888,7 +910,7 @@ function tws(classNames) {
|
|
|
888
910
|
if (opacityValue >= 0 && opacityValue <= 100) {
|
|
889
911
|
// Check if this could be a fraction (e.g., w-2/3, h-1/2)
|
|
890
912
|
// Fractions typically have denominators of 2, 3, 4, 5, 6, 12
|
|
891
|
-
const couldBeFraction = FRACTION_DENOMINATORS.includes(opacityValue) && FRACTION_PREFIXES.some(prefix => className.startsWith(prefix) || className.startsWith(
|
|
913
|
+
const couldBeFraction = FRACTION_DENOMINATORS.includes(opacityValue) && FRACTION_PREFIXES.some(prefix => className.startsWith(prefix) || className.startsWith("-".concat(prefix)));
|
|
892
914
|
if (!couldBeFraction) {
|
|
893
915
|
baseClassName = className.replace(/\/\d+$/, "");
|
|
894
916
|
hasOpacityModifier = true;
|
|
@@ -907,8 +929,8 @@ function tws(classNames) {
|
|
|
907
929
|
if (match) {
|
|
908
930
|
const customValue = match[1];
|
|
909
931
|
const baseKey = baseClassName.split("[")[0];
|
|
910
|
-
if (cssObject[
|
|
911
|
-
let customResult = cssObject[
|
|
932
|
+
if (cssObject["".concat(baseKey, "custom")]) {
|
|
933
|
+
let customResult = cssObject["".concat(baseKey, "custom")].replace(/custom_value/g, customValue);
|
|
912
934
|
// Apply opacity modifier to custom values too
|
|
913
935
|
if (hasOpacityModifier && className.includes("/") && /\/\d+$/.test(className)) {
|
|
914
936
|
customResult = processOpacityModifier(className, customResult);
|
|
@@ -962,14 +984,14 @@ function debounce(func) {
|
|
|
962
984
|
callCount++;
|
|
963
985
|
clearTimeout(timeout);
|
|
964
986
|
timeout = setTimeout(() => {
|
|
965
|
-
const marker = performanceMonitor.start(
|
|
987
|
+
const marker = performanceMonitor.start("debounced:".concat(func.name || "anonymous"));
|
|
966
988
|
try {
|
|
967
989
|
const result = func.apply(context, args);
|
|
968
990
|
performanceMonitor.end(marker);
|
|
969
991
|
return result;
|
|
970
992
|
} catch (error) {
|
|
971
993
|
performanceMonitor.end(marker);
|
|
972
|
-
logger.error(
|
|
994
|
+
logger.error("Debounced function error (call #".concat(callCount, "):"), error);
|
|
973
995
|
throw error;
|
|
974
996
|
}
|
|
975
997
|
}, wait);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tws.cjs","sources":["../../src/utils/tailwindCache.js","../../src/utils/errorHandler.js","../../src/css/resolver.js","../../src/css/parser.js","../../src/core/constants.js","../../src/core/tws.js"],"sourcesContent":["/**\n * Tailwind Cache - Minimal implementation (post-cleanup)\n * Directly invokes generator/converter without persistent caching.\n */\n\nlet _cachedCssObject = null;\n\nexport function resetTailwindCache() {\n _cachedCssObject = null;\n}\n\nexport function getTailwindCache() {\n return {\n getOrGenerate(generateFn, convertFn) {\n if (_cachedCssObject) return _cachedCssObject;\n const cssString = generateFn ? generateFn() : \"\";\n _cachedCssObject = convertFn ? convertFn(cssString) : {};\n return _cachedCssObject;\n },\n get(className) {\n return _cachedCssObject?.[className];\n },\n set(className, value) {\n if (_cachedCssObject) _cachedCssObject[className] = value;\n },\n has(className) {\n return !!_cachedCssObject?.[className];\n },\n clear() {\n _cachedCssObject = null;\n }\n };\n}\n","/**\n * Error Handler - Stub (post-cleanup)\n */\n\nexport class TwsError extends Error {\n constructor(message, code = \"UNKNOWN_ERROR\") {\n super(message);\n this.code = code;\n this.name = \"TwsError\";\n }\n}\n\nexport function onError(_handler) {\n // No-op in stub mode\n}\n\nexport function handleError(error, context = \"\") {\n if (typeof console !== \"undefined\" && console.warn) {\n console.warn(`[react-tailwind-theme]${context ? ` [${context}]` : \"\"} ${error?.message || error}`);\n }\n return null;\n}\n","/**\n * CSS Resolver - Stub (post-cleanup)\n * Original file was removed during scope reduction.\n * This stub maintains import compatibility.\n */\n\nexport function separateAndResolveCSS(_className) {\n return \"\";\n}\n\nexport function resolveCssToClearCss(css) {\n return css;\n}\n\nexport function inlineStyleToJson(styleString) {\n const result = {};\n if (!styleString || typeof styleString !== \"string\") return result;\n const pairs = styleString.split(\";\");\n for (const pair of pairs) {\n const [prop, val] = pair.split(\":\");\n if (prop && val) result[prop.trim()] = val.trim();\n }\n return result;\n}\n","/**\n * CSS Parser - Stub (post-cleanup)\n * Original file was removed during scope reduction.\n * This stub maintains import compatibility.\n */\n\nexport function processOpacityModifier(_className, _opacity) {\n return null;\n}\n\nexport function parseClassName(className) {\n return { prefix: \"\", core: className, suffix: \"\" };\n}\n","/**\n * Pre-compiled Regex Constants and Configuration\n * \n * Pre-compiling regex patterns provides 50-100x performance improvement\n * by avoiding repeated regex object creation in hot code paths.\n * \n * @module core/constants\n */\n\n// ============================================================================\n// CLASS PARSING\n// ============================================================================\n\n/** Regex for parsing Tailwind class names (includes . for decimal values like p-0.5) */\nexport const CLASS_PARSER_REGEX = /[\\w.\\-\\/]+(?:\\/\\d+)?(?:\\[[^\\]]+\\])?/g;\n\n// ============================================================================\n// OPACITY MODIFIERS\n// ============================================================================\n\n/** Regex for extracting opacity modifiers (e.g., /50 in text-red-500/50) */\nexport const OPACITY_MODIFIER_REGEX = /\\/(\\d+)$/;\n\n/** Pre-compiled regex patterns for opacity CSS custom properties */\nexport const OPACITY_PROP_REGEXES = {\n \"--text-opacity\": /--text-opacity\\s*:\\s*[\\d.]+/gi,\n \"--bg-opacity\": /--bg-opacity\\s*:\\s*[\\d.]+/gi,\n \"--border-opacity\": /--border-opacity\\s*:\\s*[\\d.]+/gi,\n \"--ring-opacity\": /--ring-opacity\\s*:\\s*[\\d.]+/gi,\n \"--divide-opacity\": /--divide-opacity\\s*:\\s*[\\d.]+/gi,\n \"--placeholder-opacity\": /--placeholder-opacity\\s*:\\s*[\\d.]+/gi,\n \"--text-decoration-opacity\": /--text-decoration-opacity\\s*:\\s*[\\d.]+/gi,\n \"--outline-opacity\": /--outline-opacity\\s*:\\s*[\\d.]+/gi,\n \"--accent-opacity\": /--accent-opacity\\s*:\\s*[\\d.]+/gi,\n \"--caret-opacity\": /--caret-opacity\\s*:\\s*[\\d.]+/gi,\n};\n\n// ============================================================================\n// CSS PARSING\n// ============================================================================\n\n/** Regex for parsing CSS class rules */\nexport const CSS_CLASS_REGEX = /([a-zA-Z0-9\\-_\\\\/.]+)\\s*{\\s*([^}]+)\\s*}/g;\n\n/** Regex for CSS string manipulation */\nexport const DOUBLE_BACKSLASH_REGEX = /\\\\\\\\/g;\nexport const LEADING_UNDERSCORE_REGEX = /^_/;\nexport const MULTIPLE_SPACES_REGEX = /\\s+/g;\n\n/** Regex for CSS declarations */\nexport const CSS_SEMICOLON_SPLIT_REGEX = /;/;\nexport const CSS_COLON_SPLIT_REGEX = /:/;\n\n// ============================================================================\n// BRACKET ENCODING/DECODING\n// ============================================================================\n\n/** Regex for bracket content extraction and encoding */\nexport const BRACKET_CONTENT_REGEX = /\\[([^\\]]+)\\]/g;\nexport const OPENING_PAREN_REGEX = /\\(/g;\nexport const CLOSING_PAREN_REGEX = /\\)/g;\nexport const ENCODED_PAREN_OPEN_REGEX = /__P__/g;\nexport const ENCODED_PAREN_CLOSE_REGEX = /__C__/g;\n\n// ============================================================================\n// VARIANT EXPANSION\n// ============================================================================\n\n/** Regex for directive group expansion (e.g., p(4 8) -> p-4 p-8) */\nexport const DIRECTIVE_GROUP_REGEX = /(\\w+)\\(([^()]+)\\)/g;\n\n/** Regex for variant group expansion (e.g., hover:(text-blue bg-blue)) */\nexport const VARIANT_GROUP_REGEX = /(\\w+):\\(([^()]+(?:\\((?:[^()]+)\\))?[^()]*)\\)/g;\n\nexport const WHITESPACE_SPLIT_REGEX = /\\s+/;\nexport const VARIANT_COLON_SPLIT_REGEX = /:/;\n\n// ============================================================================\n// CSS VARIABLE RESOLUTION\n// ============================================================================\n\n/** Regex for CSS custom property (var) resolution — supports nested parens in fallback (e.g. rgba(...)) */\nexport const CSS_VAR_REGEX = /var\\((--[\\w-]+)(?:,\\s*((?:[^()]+|\\([^()]*\\))*))?\\)/g;\nexport const CAMEL_CASE_REGEX = /-([a-z])/g;\n\n// ============================================================================\n// ANIMATION DETECTION\n// ============================================================================\n\n/** Regex for detecting animation names in CSS */\nexport const ANIMATION_NAME_REGEX = /animation(?:-name)?:\\s*([a-zA-Z0-9-]+)/gi;\n\n// ============================================================================\n// CUSTOM CLASS DETECTION\n// ============================================================================\n\n/** Regex for arbitrary value detection (e.g., w-[123px]) */\nexport const CUSTOM_VALUE_BRACKET_REGEX = /\\[([^\\]]+)\\]/;\nexport const CUSTOM_VALUE_FULL_REGEX = /^(.+?)\\[(.+)\\]$/;\n\n// ============================================================================\n// SELECTOR VARIANTS\n// ============================================================================\n\n/** Regex for selector variants (e.g., c-first, c-odd) */\nexport const SELECTOR_VARIANT_REGEX = /c-(first|last|odd|even|\\d+|not\\([^)]+\\))/g;\nexport const NOT_SELECTOR_REGEX = /^not\\(([^)]+)\\)$/;\nexport const DIGIT_ONLY_REGEX = /^\\d+$/;\n\n// ============================================================================\n// COLOR PROPERTIES\n// ============================================================================\n\n/** List of CSS properties that accept color values */\nexport const COLOR_PROPERTIES = [\n \"color\",\n \"background-color\",\n \"border-color\",\n \"text-decoration-color\",\n \"outline-color\",\n \"fill\",\n \"stroke\",\n \"caret-color\",\n \"accent-color\",\n];\n\n/**\n * Pre-compiled regex patterns for each color property\n * Used in opacity modifier processing for 50-100x performance improvement\n */\nexport const COLOR_REGEX_PATTERNS = new Map();\nfor (const prop of COLOR_PROPERTIES) {\n const escapedProp = prop.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n COLOR_REGEX_PATTERNS.set(prop, {\n rgb: new RegExp(\n `(${escapedProp}\\\\s*:\\\\s*)rgb\\\\((\\\\d+),\\\\s*(\\\\d+),\\\\s*(\\\\d+)\\\\)`,\n \"gi\"\n ),\n rgba: new RegExp(\n `(${escapedProp}\\\\s*:\\\\s*)rgba\\\\((\\\\d+),\\\\s*(\\\\d+),\\\\s*(\\\\d+),\\\\s*[\\\\d.]+\\\\)`,\n \"gi\"\n ),\n hsl: new RegExp(\n `(${escapedProp}\\\\s*:\\\\s*)hsl\\\\((\\\\d+),\\\\s*([\\\\d.]+%),\\\\s*([\\\\d.]+%)\\\\)`,\n \"gi\"\n ),\n hsla: new RegExp(\n `(${escapedProp}\\\\s*:\\\\s*)hsla\\\\((\\\\d+),\\\\s*([\\\\d.]+%),\\\\s*([\\\\d.]+%),\\\\s*[\\\\d.]+\\\\)`,\n \"gi\"\n ),\n hex: new RegExp(`(${escapedProp}\\\\s*:\\\\s*)(#[0-9a-fA-F]{3,6})`, \"gi\"),\n });\n}\n\n// ============================================================================\n// CSS PROPERTY CONVERSION\n// ============================================================================\n\n/** Regex for converting camelCase to kebab-case */\nexport const UPPERCASE_LETTER_REGEX = /([A-Z])/g;\n\n/** Regex for escaping special characters */\nexport const ESCAPE_SLASH_REGEX = /\\//g;\nexport const ESCAPE_DOT_REGEX = /\\./g;\n\n// ============================================================================\n// TAILWIND CONFIGURATION\n// ============================================================================\n\n/** Fraction denominators supported in Tailwind (for w-1/2, h-2/3, etc.) */\nexport const FRACTION_DENOMINATORS = [2, 3, 4, 5, 6, 12];\n\n/** Prefixes that support fractional values */\nexport const FRACTION_PREFIXES = [\n \"w-\",\n \"h-\",\n \"max-w-\",\n \"max-h-\",\n \"min-w-\",\n \"min-h-\",\n \"top-\",\n \"bottom-\",\n \"left-\",\n \"right-\",\n \"inset-\",\n \"inset-x-\",\n \"inset-y-\",\n \"translate-x-\",\n \"translate-y-\",\n \"rounded-t-\",\n \"rounded-b-\",\n \"rounded-l-\",\n \"rounded-r-\",\n \"rounded-bl-\",\n \"rounded-br-\",\n \"rounded-tl-\",\n \"rounded-tr-\",\n \"flex-basis-\",\n \"z-\",\n];\n\n/** Responsive breakpoints */\nexport const BREAKPOINTS = {\n // Standard responsive breakpoints (Tailwind v3 + v4)\n sm: \"@media (min-width: 640px)\",\n md: \"@media (min-width: 768px)\",\n lg: \"@media (min-width: 1024px)\",\n xl: \"@media (min-width: 1280px)\",\n \"2xl\": \"@media (min-width: 1536px)\",\n \"3xl\": \"@media (min-width: 1920px)\",\n // Container queries (Tailwind v4)\n \"@sm\": \"@container (min-width: 640px)\",\n \"@md\": \"@container (min-width: 768px)\",\n \"@lg\": \"@container (min-width: 1024px)\",\n \"@xl\": \"@container (min-width: 1280px)\",\n \"@2xl\": \"@container (min-width: 1536px)\",\n \"@3xl\": \"@container (min-width: 1920px)\",\n // Special media variants (Tailwind v4)\n \"starting\": \"@starting-style\",\n \"forced-colors\": \"@media (forced-colors: active)\",\n print: \"@media print\",\n portrait: \"@media (orientation: portrait)\",\n landscape: \"@media (orientation: landscape)\",\n};\n\n/** Pseudo-class variants */\nexport const PSEUDO_VARIANTS = new Set([\n \"hover\",\n \"focus\",\n \"focus-within\",\n \"focus-visible\",\n \"active\",\n \"visited\",\n \"disabled\",\n \"enabled\",\n \"first\",\n \"last\",\n \"checked\",\n \"unchecked\",\n \"indeterminate\",\n \"invalid\",\n \"valid\",\n \"required\",\n \"optional\",\n \"read-only\",\n \"read-write\",\n \"placeholder-shown\",\n \"autofill\",\n \"even\",\n \"odd\",\n \"empty\",\n \"target\",\n \"default\",\n \"in-range\",\n \"out-of-range\",\n \"user-invalid\",\n \"user-valid\",\n]);\n\n/**\n * Attribute-based variants — generate [attr] selectors instead of :pseudo\n * Added in Tailwind v4 (e.g., details[open], dialog[open])\n */\nexport const ATTRIBUTE_VARIANTS = new Set([\n \"open\",\n]);\n\n/** Special variant handlers */\nexport const SPECIAL_VARIANTS = {\n group: (state, sel) => `.group:${state} ${sel}`,\n peer: (state, sel) => `.peer:${state} ~ ${sel}`,\n dark: (state, sel) => `.dark ${sel}`,\n // Tailwind v4: not-* and has-* structural variants\n not: (state, sel) => `${sel}:not(${state})`,\n has: (state, sel) => `${sel}:has(${state})`,\n \"aria\": (state, sel) => `${sel}[aria-${state}]`,\n \"data\": (state, sel) => `${sel}[data-${state}]`,\n // Modern selector variants\n \"is\": (state, sel) => `${sel}:is(${state})`,\n \"where\": (state, sel) => `${sel}:where(${state})`,\n \"has-not\": (state, sel) => `${sel}:has(:not(${state}))`,\n \"group-has\": (state, sel) => `.group:has(${state}) ${sel}`,\n \"peer-has\": (state, sel) => `.peer:has(${state}) ~ ${sel}`,\n \"group-not\": (state, sel) => `.group:not(${state}) ${sel}`,\n \"peer-not\": (state, sel) => `.peer:not(${state}) ~ ${sel}`,\n \"group-is\": (state, sel) => `.group:is(${state}) ${sel}`,\n \"peer-is\": (state, sel) => `.peer:is(${state}) ~ ${sel}`,\n \"group-where\": (state, sel) => `.group:where(${state}) ${sel}`,\n \"peer-where\": (state, sel) => `.peer:where(${state}) ~ ${sel}`,\n // Reduced motion / accessibility\n \"motion-safe\": (state, sel) => `@media (prefers-reduced-motion: no-preference) { ${sel} }`,\n \"motion-reduce\": (state, sel) => `@media (prefers-reduced-motion: reduce) { ${sel} }`,\n \"contrast-more\": (state, sel) => `@media (prefers-contrast: more) { ${sel} }`,\n \"contrast-less\": (state, sel) => `@media (prefers-contrast: less) { ${sel} }`,\n};\n\n/** Selector variants for child selection */\nexport const SELECTOR_VARIANTS = {\n first: () => \"> :first-child\",\n last: () => \"> :last-child\",\n odd: () => \"> :nth-child(odd)\",\n even: () => \"> :nth-child(even)\",\n not: (arg) => `> :not(${arg})`,\n number: (arg) => `> :nth-child(${arg})`,\n \"has\": (arg) => `:has(> ${arg})`,\n \"is\": (arg) => `:is(> ${arg})`,\n \"where\": (arg) => `:where(> ${arg})`,\n};\n\n// ============================================================================\n// SMART SELECTOR VARIANTS (Modern CSS selectors)\n// ============================================================================\n\n/** Regex for has-[...] variant */\nexport const HAS_VARIANT_REGEX = /has-\\[([^\\]]+)\\]/;\n\n/** Regex for not-[...] variant */\nexport const NOT_VARIANT_REGEX = /not-\\[([^\\]]+)\\]/;\n\n/** Regex for is-[...] variant */\nexport const IS_VARIANT_REGEX = /is-\\[([^\\]]+)\\]/;\n\n/** Regex for where-[...] variant */\nexport const WHERE_VARIANT_REGEX = /where-\\[([^\\]]+)\\]/;\n\n/** Regex for aria-[...] variant */\nexport const ARIA_VARIANT_REGEX = /aria-\\[([^\\]]+)\\]/;\n\n/** Regex for data-[...] variant */\nexport const DATA_VARIANT_REGEX = /data-\\[([^\\]]+)\\]/;\n\n/** Regex for group-has-[...] variant */\nexport const GROUP_HAS_VARIANT_REGEX = /group-has-\\[([^\\]]+)\\]/;\n\n/** Regex for peer-has-[...] variant */\nexport const PEER_HAS_VARIANT_REGEX = /peer-has-\\[([^\\]]+)\\]/;\n\n/** Regex for group-not-[...] variant */\nexport const GROUP_NOT_VARIANT_REGEX = /group-not-\\[([^\\]]+)\\]/;\n\n/** Regex for peer-not-[...] variant */\nexport const PEER_NOT_VARIANT_REGEX = /peer-not-\\[([^\\]]+)\\]/;\n\n// ============================================================================\n// CSS NESTING & SCOPE\n// ============================================================================\n\n/** Regex for @scope detection */\nexport const SCOPE_AT_RULE_REGEX = /@scope\\s*\\(\\s*([^)]+)\\s*\\)(?:\\s+to\\s*\\(\\s*([^)]+)\\s*\\))?/;\n\n/** Regex for @container detection */\nexport const CONTAINER_AT_RULE_REGEX = /@container\\s+([^\\{]+)/;\n\n/** Regex for @position-try detection */\nexport const POSITION_TRY_AT_RULE_REGEX = /@position-try\\s+([^\\{]+)/;\n\n// ============================================================================\n// MODERN CSS PROPERTIES\n// ============================================================================\n\n/** CSS properties that support oklch */\nexport const OKLCH_COLOR_PROPERTIES = [\n \"color\",\n \"background-color\",\n \"border-color\",\n \"text-decoration-color\",\n \"outline-color\",\n \"fill\",\n \"stroke\",\n \"caret-color\",\n \"accent-color\",\n \"column-rule-color\",\n];\n\n/** Modern color space keywords */\nexport const MODERN_COLOR_SPACES = [\"oklch\", \"oklab\", \"lab\", \"lch\", \"display-p3\", \"srgb\", \"hsl\", \"hwb\"];\n\n// ============================================================================\n// ANIMATION KEYFRAMES\n// ============================================================================\n\n/** Built-in Tailwind animation keyframes */\nexport const BUILTIN_KEYFRAMES = {\n spin: {\n \"0%\": { transform: \"rotate(0deg)\" },\n \"100%\": { transform: \"rotate(360deg)\" },\n },\n ping: {\n \"75%, 100%\": { transform: \"scale(2)\", opacity: \"0\" },\n },\n pulse: {\n \"50%\": { opacity: \".5\" },\n },\n bounce: {\n \"0%, 100%\": {\n transform: \"translateY(-25%)\",\n animationTimingFunction: \"cubic-bezier(0.8,0,1,1)\",\n },\n \"50%\": {\n transform: \"none\",\n animationTimingFunction: \"cubic-bezier(0,0,0.2,1)\",\n },\n },\n fadeIn: {\n \"0%\": { opacity: \"0\" },\n \"50%\": { opacity: \"1\" },\n \"100%\": { opacity: \"0\" },\n },\n slideUp: {\n \"0%\": { transform: \"translateY(20px)\", opacity: \"0\" },\n \"50%\": { transform: \"translateY(0)\", opacity: \"1\" },\n \"100%\": { transform: \"translateY(-20px)\", opacity: \"0\" },\n },\n};\n","/**\n * TWS Core - Tailwind to Style Converter\n * \n * Main function for converting Tailwind class names to inline styles or JSON objects.\n * \n * @module core/tws\n */\n\nimport { getTailwindCache } from \"../utils/tailwindCache.js\";\nconst logger = { warn: () => {}, error: () => {}, info: () => {}, debug: () => {} };\nimport { handleError } from \"../utils/errorHandler.js\";\nconst performanceMonitor = {\n start: () => 0,\n end: () => {},\n measure: (fn) => fn(),\n};\nimport { separateAndResolveCSS, resolveCssToClearCss, inlineStyleToJson } from \"../css/resolver.js\";\nimport { processOpacityModifier } from \"../css/parser.js\";\nimport {\n CLASS_PARSER_REGEX,\n OPACITY_MODIFIER_REGEX,\n CUSTOM_VALUE_BRACKET_REGEX,\n FRACTION_DENOMINATORS,\n FRACTION_PREFIXES,\n} from \"../core/constants.js\";\n\n/**\n * Convert Tailwind class string to inline CSS styles or JSON object\n * \n * Supports all Tailwind utilities including:\n * - Responsive variants (sm:, md:, lg:, xl:, 2xl:)\n * - Pseudo-state variants (hover:, focus:, active:, etc.)\n * - Opacity modifiers (text-red-500/50)\n * - Arbitrary values (w-[123px], text-[#abc])\n * - Important modifier (!bg-red-500)\n * \n * @param {string} classNames - String containing Tailwind classes to convert\n * @param {boolean} convertToJson - If true, returns JSON object; if false, returns CSS string\n * @returns {string|Object} Inline CSS string or style JSON object\n * \n * @example\n * // CSS string output\n * tws('bg-blue-500 text-white p-4')\n * // Returns: 'background-color: rgb(59, 130, 246); color: rgb(255, 255, 255); padding: 1rem;'\n * \n * @example\n * // JSON object output\n * tws('flex items-center gap-4', true)\n * // Returns: { display: 'flex', alignItems: 'center', gap: '1rem' }\n * \n * @example\n * // Opacity modifiers\n * tws('text-red-500/50')\n * // Returns: 'color: rgba(239, 68, 68, 0.5);'\n * \n * @example\n * // Arbitrary values\n * tws('w-[123px] text-[#abc]')\n * // Returns: 'width: 123px; color: #abc;'\n */\nexport function tws(classNames, convertToJson = false) {\n const totalMarker = performanceMonitor.start(\"tws:total\");\n\n try {\n // Get CSS object from singleton cache (auto-generates if needed)\n const tailwindCache = getTailwindCache();\n const cssObject = tailwindCache.getOrGenerate(\n // generateFn and convertFn arehandled by tailwindCache\n );\n\n // Validate input\n if (\n !classNames ||\n typeof classNames !== \"string\" ||\n classNames.trim() === \"\"\n ) {\n performanceMonitor.end(totalMarker);\n return convertToJson ? {} : \"\";\n }\n\n // Parse class names\n let classes;\n try {\n const parseMarker = performanceMonitor.start(\"tws:parse\");\n CLASS_PARSER_REGEX.lastIndex = 0; // Reset global regex\n classes = classNames.match(CLASS_PARSER_REGEX);\n performanceMonitor.end(parseMarker);\n\n // If no valid classes are found\n if (!classes || classes.length === 0) {\n logger.warn(\n `No valid Tailwind classes found in input: \"${classNames}\"`\n );\n performanceMonitor.end(totalMarker);\n return convertToJson ? {} : \"\";\n }\n } catch (error) {\n logger.error(`Error parsing Tailwind classes: ${error.message}`);\n performanceMonitor.end(totalMarker);\n return convertToJson ? {} : \"\";\n }\n\n // Process classes with performance monitoring\n const processMarker = performanceMonitor.start(\"tws:process\");\n let cssResult = classes.map((className) => {\n // Extract base class name without opacity modifier\n // Only remove /digits if it's an opacity modifier (not a fraction like w-2/3)\n // Opacity modifiers are typically /0-100, fractions are /2, /3, /4, /5, /6, /12\n const opacityMatch = OPACITY_MODIFIER_REGEX.exec(className);\n let baseClassName = className;\n let hasOpacityModifier = false;\n\n if (opacityMatch) {\n const opacityValue = parseInt(opacityMatch[1], 10);\n // If it's a valid opacity value (0-100), treat it as opacity modifier\n if (opacityValue >= 0 && opacityValue <= 100) {\n // Check if this could be a fraction (e.g., w-2/3, h-1/2)\n // Fractions typically have denominators of 2, 3, 4, 5, 6, 12\n const couldBeFraction =\n FRACTION_DENOMINATORS.includes(opacityValue) &&\n FRACTION_PREFIXES.some(\n (prefix) =>\n className.startsWith(prefix) ||\n className.startsWith(`-${prefix}`)\n );\n if (!couldBeFraction) {\n baseClassName = className.replace(/\\/\\d+$/, \"\");\n hasOpacityModifier = true;\n }\n }\n }\n\n let result =\n cssObject[baseClassName] ||\n cssObject[baseClassName.replace(/\\//g, \"\\\\/\")] ||\n cssObject[baseClassName.replace(/\\./g, \"\\\\.\")];\n\n if (result) {\n // Apply opacity modifier if present\n if (\n hasOpacityModifier &&\n className.includes(\"/\") &&\n /\\/\\d+$/.test(className)\n ) {\n result = processOpacityModifier(className, result);\n }\n return resolveCssToClearCss(result);\n } else if (baseClassName.includes(\"[\")) {\n const match = CUSTOM_VALUE_BRACKET_REGEX.exec(baseClassName);\n if (match) {\n const customValue = match[1];\n const baseKey = baseClassName.split(\"[\")[0];\n if (cssObject[`${baseKey}custom`]) {\n let customResult = cssObject[`${baseKey}custom`].replace(\n /custom_value/g,\n customValue\n );\n // Apply opacity modifier to custom values too\n if (\n hasOpacityModifier &&\n className.includes(\"/\") &&\n /\\/\\d+$/.test(className)\n ) {\n customResult = processOpacityModifier(className, customResult);\n }\n return customResult;\n }\n }\n }\n return \"\";\n });\n performanceMonitor.end(processMarker);\n\n // Resolve CSS\n cssResult = performanceMonitor.measure(\n () => separateAndResolveCSS(cssResult),\n \"tws:resolve\"\n );\n\n // Convert to JSON if needed\n if (convertToJson) {\n cssResult = performanceMonitor.measure(\n () => inlineStyleToJson(cssResult),\n \"tws:json\"\n );\n }\n\n performanceMonitor.end(totalMarker);\n return cssResult;\n } catch (error) {\n performanceMonitor.end(totalMarker);\n handleError(error, { classNames, convertToJson });\n return convertToJson ? {} : \"\";\n }\n}\n\n/**\n * Debounced version of tws function\n * \n * Useful for real-time class name updates in UI.\n * \n * @param {string} classNames - String containing Tailwind classes\n * @param {boolean} convertToJson - If true, returns JSON object\n * @param {number} wait - Debounce delay in milliseconds (default: 50ms)\n * @returns {Function} Debounced tws function\n */\nexport function debounce(func, wait = 100) {\n let timeout;\n let callCount = 0;\n\n return function (...args) {\n const context = this;\n callCount++;\n\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n const marker = performanceMonitor.start(\n `debounced:${func.name || \"anonymous\"}`\n );\n try {\n const result = func.apply(context, args);\n performanceMonitor.end(marker);\n return result;\n } catch (error) {\n performanceMonitor.end(marker);\n logger.error(`Debounced function error (call #${callCount}):`, error);\n throw error;\n }\n }, wait);\n };\n}\n\n/** Debounced version of tws with 50ms delay */\nexport const debouncedTws = debounce(tws, 50);\n"],"names":["_cachedCssObject","getTailwindCache","getOrGenerate","generateFn","convertFn","cssString","get","className","_cachedCssObject2","set","value","has","_cachedCssObject3","clear","handleError","error","context","arguments","length","undefined","console","warn","concat","message","separateAndResolveCSS","_className","resolveCssToClearCss","css","inlineStyleToJson","styleString","result","pairs","split","pair","_pair$split","_pair$split2","_slicedToArray","prop","val","trim","processOpacityModifier","_opacity","CLASS_PARSER_REGEX","OPACITY_MODIFIER_REGEX","CUSTOM_VALUE_BRACKET_REGEX","COLOR_PROPERTIES","COLOR_REGEX_PATTERNS","Map","escapedProp","replace","rgb","RegExp","rgba","hsl","hsla","hex","FRACTION_DENOMINATORS","FRACTION_PREFIXES","logger","info","debug","performanceMonitor","start","end","measure","fn","tws","classNames","convertToJson","totalMarker","tailwindCache","cssObject","classes","parseMarker","lastIndex","match","processMarker","cssResult","map","opacityMatch","exec","baseClassName","hasOpacityModifier","opacityValue","parseInt","couldBeFraction","includes","some","prefix","startsWith","test","customValue","baseKey","customResult","debounce","func","wait","timeout","_len","args","Array","_key","clearTime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