@webmate-studio/builder 0.2.119 → 0.2.121

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.119",
3
+ "version": "0.2.121",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -978,7 +978,9 @@ body {
978
978
 
979
979
  // Generate utility classes for buttons
980
980
  if (tokens.buttons) {
981
+ // IMPORTANT: Buttons in @layer components so Tailwind utilities (rounded-full, etc.) can override
981
982
  globalStyles += '\n\n/* Button Utilities */';
983
+ globalStyles += '\n@layer components {';
982
984
 
983
985
  // Base button class
984
986
  globalStyles += `\n.btn {
@@ -1024,6 +1026,8 @@ body {
1024
1026
  border-color: var(--button-${variantName}-border-hover);
1025
1027
  }`;
1026
1028
  }
1029
+
1030
+ globalStyles += '\n}'; // Close @layer components
1027
1031
  }
1028
1032
 
1029
1033
  // Add responsive media queries for textStyles (OUTSIDE @theme block!)
@@ -147,6 +147,32 @@ export function extractTailwindClasses(html) {
147
147
  }
148
148
  }
149
149
 
150
+ // Match .className = '...' and .className = "..." (vanilla JS DOM manipulation in Islands)
151
+ // Also matches .className = `...` template literals
152
+ const classNameAssignRegex = /\.className\s*=\s*['"]([^'"]+)['"]/g;
153
+ while ((match = classNameAssignRegex.exec(html)) !== null) {
154
+ match[1].split(/\s+/).forEach(cls => {
155
+ if (cls.trim()) classes.add(cls.trim());
156
+ });
157
+ }
158
+ // Template literal version: .className = `...`
159
+ const classNameTemplateRegex = /\.className\s*=\s*`([^`]*)`/g;
160
+ while ((match = classNameTemplateRegex.exec(html)) !== null) {
161
+ // Extract static parts (before/between/after ${...})
162
+ const content = match[1].replace(/\$\{[^}]*\}/g, ' ');
163
+ content.split(/\s+/).forEach(cls => {
164
+ if (cls.trim()) classes.add(cls.trim());
165
+ });
166
+ }
167
+
168
+ // Match classList.add('...') patterns
169
+ const classListAddRegex = /classList\.add\(\s*['"]([^'"]+)['"]/g;
170
+ while ((match = classListAddRegex.exec(html)) !== null) {
171
+ match[1].split(/\s+/).forEach(cls => {
172
+ if (cls.trim()) classes.add(cls.trim());
173
+ });
174
+ }
175
+
150
176
  return classes;
151
177
  }
152
178