@webjourney/vite-plugins 1.2.7-0 → 1.2.7-1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EA8JrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAIlC;AAED,wBAAgB,iBAAiB;;;oBA3Kb,MAAM,MAAM,MAAM;;;;;;;6BAqKT,MAAM;KAUlC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EA6KrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAIlC;AAED,wBAAgB,iBAAiB;;;oBA1Lb,MAAM,MAAM,MAAM;;;;;;;6BAoLT,MAAM;KAUlC"}
package/dist/index.js CHANGED
@@ -34,6 +34,16 @@ export function webjourneyElementTagger() {
34
34
  traverse(ast, {
35
35
  JSXElement(path) {
36
36
  const openingElement = path.node.openingElement;
37
+ // Skip wrapper spans we created (they have data-wj-text attribute)
38
+ const isWrapperSpan = t.isJSXIdentifier(openingElement.name) &&
39
+ openingElement.name.name === 'span' &&
40
+ openingElement.attributes.some((attr) => t.isJSXAttribute(attr) &&
41
+ t.isJSXIdentifier(attr.name) &&
42
+ attr.name.name === 'data-wj-text');
43
+ if (isWrapperSpan) {
44
+ path.skip(); // Don't traverse into our wrapper spans
45
+ return;
46
+ }
37
47
  const lineNumber = openingElement.loc?.start.line ?? 0;
38
48
  // Process children to wrap text nodes
39
49
  const newChildren = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjourney/vite-plugins",
3
- "version": "1.2.7-0",
3
+ "version": "1.2.7-1",
4
4
  "description": "Vite plugins for Webjourney WYSIWYG editing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",