@webmate-studio/builder 0.2.120 → 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.120",
3
+ "version": "0.2.121",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -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