@webmate-studio/builder 0.2.79 → 0.2.80
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 +1 -1
- package/src/html-cleaner.js +8 -1
package/package.json
CHANGED
package/src/html-cleaner.js
CHANGED
|
@@ -58,11 +58,18 @@ function transformIslandsToDataAttributes(html, availableIslands = []) {
|
|
|
58
58
|
// Convert island name to kebab-case for Custom Element tag
|
|
59
59
|
// SwiperTest → swiper-test
|
|
60
60
|
// MyAwesomeComponent → my-awesome-component
|
|
61
|
-
|
|
61
|
+
let kebabTag = tagName
|
|
62
62
|
.replace(/([A-Z])/g, '-$1')
|
|
63
63
|
.toLowerCase()
|
|
64
64
|
.replace(/^-/, '');
|
|
65
65
|
|
|
66
|
+
// Svelte requires custom element names to be hyphenated
|
|
67
|
+
// If there's no hyphen, add a prefix to make it valid
|
|
68
|
+
// IMPORTANT: Must match the prefix logic in injectSvelteOptions()
|
|
69
|
+
if (!kebabTag.includes('-')) {
|
|
70
|
+
kebabTag = 'wm-' + kebabTag; // e.g., "sidebar" → "wm-sidebar"
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// Parse attributes and convert to HTML attributes
|
|
67
74
|
const attrs = [];
|
|
68
75
|
|