myoperator-ui 0.0.14 → 0.0.16
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/index.js +14 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import ora from "ora";
|
|
|
13
13
|
// src/utils/registry.ts
|
|
14
14
|
function prefixTailwindClasses(content, prefix) {
|
|
15
15
|
if (!prefix) return content;
|
|
16
|
+
const cleanPrefix = prefix.replace(/-/g, "");
|
|
16
17
|
return content.replace(/"([^"]+)"/g, (match, classString) => {
|
|
17
18
|
if (classString.startsWith("@") || classString.startsWith(".") || classString.includes("::")) {
|
|
18
19
|
return match;
|
|
@@ -30,23 +31,23 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
30
31
|
const variants = variantMatch[0];
|
|
31
32
|
const utility = cls.slice(variants.length);
|
|
32
33
|
if (utility.startsWith("-")) {
|
|
33
|
-
return `${variants}-${
|
|
34
|
+
return `${variants}-${cleanPrefix}${utility.slice(1)}`;
|
|
34
35
|
}
|
|
35
|
-
return `${variants}${
|
|
36
|
+
return `${variants}${cleanPrefix}${utility}`;
|
|
36
37
|
}
|
|
37
38
|
if (cls.startsWith("-")) {
|
|
38
|
-
return `-${
|
|
39
|
+
return `-${cleanPrefix}${cls.slice(1)}`;
|
|
39
40
|
}
|
|
40
41
|
if (cls.startsWith("[&")) {
|
|
41
42
|
const closeBracket = cls.indexOf("]:");
|
|
42
43
|
if (closeBracket !== -1) {
|
|
43
44
|
const selector = cls.slice(0, closeBracket + 2);
|
|
44
45
|
const utility = cls.slice(closeBracket + 2);
|
|
45
|
-
return `${selector}${
|
|
46
|
+
return `${selector}${cleanPrefix}${utility}`;
|
|
46
47
|
}
|
|
47
48
|
return cls;
|
|
48
49
|
}
|
|
49
|
-
return `${
|
|
50
|
+
return `${cleanPrefix}${cls}`;
|
|
50
51
|
}).join(" ");
|
|
51
52
|
return `"${prefixedClasses}"`;
|
|
52
53
|
});
|
|
@@ -332,8 +333,10 @@ var CSS_VARIABLES_V4 = `@import "tailwindcss";
|
|
|
332
333
|
--ring: 212.7 26.8% 83.9%;
|
|
333
334
|
}
|
|
334
335
|
`;
|
|
335
|
-
var getCSS_VARIABLES_V4_BOOTSTRAP = (prefix) =>
|
|
336
|
-
|
|
336
|
+
var getCSS_VARIABLES_V4_BOOTSTRAP = (prefix) => {
|
|
337
|
+
const cleanPrefix = (prefix || "tw").replace(/-/g, "");
|
|
338
|
+
return `/* myOperator UI - Tailwind CSS for Bootstrap projects */
|
|
339
|
+
@import "tailwindcss" prefix(${cleanPrefix});
|
|
337
340
|
|
|
338
341
|
/* Disable Preflight (CSS reset) to avoid conflicts with Bootstrap */
|
|
339
342
|
@layer base {
|
|
@@ -341,8 +344,8 @@ var getCSS_VARIABLES_V4_BOOTSTRAP = (prefix) => `/* myOperator UI - Tailwind CSS
|
|
|
341
344
|
}
|
|
342
345
|
|
|
343
346
|
/* Tell Tailwind to scan component files for utility classes */
|
|
344
|
-
@source "./
|
|
345
|
-
@source "./
|
|
347
|
+
@source "./components/**/*.{js,ts,jsx,tsx}";
|
|
348
|
+
@source "./lib/**/*.{js,ts,jsx,tsx}";
|
|
346
349
|
|
|
347
350
|
/* myOperator UI theme colors */
|
|
348
351
|
@theme {
|
|
@@ -367,6 +370,7 @@ var getCSS_VARIABLES_V4_BOOTSTRAP = (prefix) => `/* myOperator UI - Tailwind CSS
|
|
|
367
370
|
/* End myOperator UI imports */
|
|
368
371
|
|
|
369
372
|
`;
|
|
373
|
+
};
|
|
370
374
|
var CSS_VARIABLES_V3 = `@tailwind base;
|
|
371
375
|
@tailwind components;
|
|
372
376
|
@tailwind utilities;
|
|
@@ -568,7 +572,7 @@ async function init() {
|
|
|
568
572
|
type: (prev) => prev ? "text" : null,
|
|
569
573
|
name: "prefix",
|
|
570
574
|
message: "Enter prefix for Tailwind classes:",
|
|
571
|
-
initial: "tw
|
|
575
|
+
initial: "tw"
|
|
572
576
|
},
|
|
573
577
|
{
|
|
574
578
|
type: "text",
|