@webjourney/vite-plugins 1.2.4 → 1.2.5
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/cli.js +0 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
File without changes
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EA8IrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAIlC;AAED,wBAAgB,iBAAiB;;;oBA3Jb,MAAM,MAAM,MAAM;;;;;;;6BAqJT,MAAM;KAUlC"}
|
package/dist/index.js
CHANGED
|
@@ -35,10 +35,25 @@ export function webjourneyElementTagger() {
|
|
|
35
35
|
JSXElement(path) {
|
|
36
36
|
const openingElement = path.node.openingElement;
|
|
37
37
|
const elementName = openingElement.name;
|
|
38
|
-
//
|
|
39
|
-
|
|
38
|
+
// Extract tag name - handle both regular tags and motion.* tags
|
|
39
|
+
let tagName;
|
|
40
|
+
if (t.isJSXIdentifier(elementName)) {
|
|
41
|
+
tagName = elementName.name;
|
|
42
|
+
}
|
|
43
|
+
else if (t.isJSXMemberExpression(elementName)) {
|
|
44
|
+
// Handle motion.div, motion.h1, etc.
|
|
45
|
+
if (t.isJSXIdentifier(elementName.object) &&
|
|
46
|
+
elementName.object.name === 'motion' &&
|
|
47
|
+
t.isJSXIdentifier(elementName.property)) {
|
|
48
|
+
tagName = elementName.property.name;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
40
55
|
return;
|
|
41
|
-
|
|
56
|
+
}
|
|
42
57
|
// Check if already has data-wj-file attribute
|
|
43
58
|
const hasDataWj = openingElement.attributes.some((attr) => t.isJSXAttribute(attr) &&
|
|
44
59
|
t.isJSXIdentifier(attr.name) &&
|