myoperator-ui 0.0.84 → 0.0.85
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 +20 -2
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -164,7 +164,7 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
164
164
|
i++;
|
|
165
165
|
}
|
|
166
166
|
const args = content.slice(cnMatch.index + cnMatch[0].length, i - 1);
|
|
167
|
-
|
|
167
|
+
let prefixedArgs = args.replace(
|
|
168
168
|
/"([^"]*)"/g,
|
|
169
169
|
(m, classes) => {
|
|
170
170
|
if (!looksLikeTailwindClasses(classes)) return m;
|
|
@@ -172,6 +172,14 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
172
172
|
return `"${prefixed}"`;
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
|
+
prefixedArgs = prefixedArgs.replace(
|
|
176
|
+
/'([^']*)'/g,
|
|
177
|
+
(m, classes) => {
|
|
178
|
+
if (!looksLikeTailwindClasses(classes)) return m;
|
|
179
|
+
const prefixed = prefixClassString(classes, prefix);
|
|
180
|
+
return `'${prefixed}'`;
|
|
181
|
+
}
|
|
182
|
+
);
|
|
175
183
|
result += `cn(${prefixedArgs})`;
|
|
176
184
|
lastIndex = i;
|
|
177
185
|
}
|
|
@@ -185,17 +193,27 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
185
193
|
return `className="${prefixed}"`;
|
|
186
194
|
}
|
|
187
195
|
);
|
|
196
|
+
const nonClassKeys = ["name", "description", "displayName", "type", "role", "id", "htmlFor", "for", "placeholder", "title", "alt", "src", "href", "target", "rel", "method", "action", "enctype", "accept", "pattern", "autocomplete", "value", "defaultValue", "label", "text", "message", "helperText", "ariaLabel", "ariaDescribedBy"];
|
|
188
197
|
content = content.replace(
|
|
189
198
|
/(\w+|"[^"]+"):\s*"([^"\n]+)"/g,
|
|
190
199
|
(match, key, value) => {
|
|
191
200
|
const cleanKey = key.replace(/"/g, "");
|
|
192
|
-
const nonClassKeys = ["name", "description", "displayName", "type", "role", "id", "htmlFor", "for", "placeholder", "title", "alt", "src", "href", "target", "rel", "method", "action", "enctype", "accept", "pattern", "autocomplete", "value", "defaultValue", "label", "text", "message", "helperText", "ariaLabel", "ariaDescribedBy"];
|
|
193
201
|
if (nonClassKeys.includes(cleanKey)) return match;
|
|
194
202
|
if (!looksLikeTailwindClasses(value)) return match;
|
|
195
203
|
const prefixed = prefixClassString(value, prefix);
|
|
196
204
|
return `${key}: "${prefixed}"`;
|
|
197
205
|
}
|
|
198
206
|
);
|
|
207
|
+
content = content.replace(
|
|
208
|
+
/(\w+|'[^']+'):\s*'([^'\n]+)'/g,
|
|
209
|
+
(match, key, value) => {
|
|
210
|
+
const cleanKey = key.replace(/'/g, "");
|
|
211
|
+
if (nonClassKeys.includes(cleanKey)) return match;
|
|
212
|
+
if (!looksLikeTailwindClasses(value)) return match;
|
|
213
|
+
const prefixed = prefixClassString(value, prefix);
|
|
214
|
+
return `${key}: '${prefixed}'`;
|
|
215
|
+
}
|
|
216
|
+
);
|
|
199
217
|
return content;
|
|
200
218
|
}
|
|
201
219
|
async function getRegistry(prefix = "") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myoperator-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.85",
|
|
4
4
|
"description": "CLI for adding myOperator UI components to your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"generate-registry": "node scripts/generate-registry.js",
|
|
15
15
|
"validate-registry": "node scripts/validate-registry.js",
|
|
16
16
|
"validate:prefix": "node scripts/validate-prefix-output.js",
|
|
17
|
+
"validate:coverage": "node scripts/validate-prefix-coverage.js",
|
|
17
18
|
"verify-build": "node scripts/verify-build.js",
|
|
18
19
|
"integrity:snapshot": "node scripts/check-integrity.js snapshot",
|
|
19
20
|
"integrity:verify": "node scripts/check-integrity.js verify",
|