@webjourney/vite-plugins 1.2.11-0 → 1.2.12-0

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;;;;EAkSrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAoBlC;AAED,wBAAgB,iBAAiB;;;oBA/Tb,MAAM,MAAM,MAAM;;;;;;;6BAyST,MAAM;KA0BlC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EAsUrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAoBlC;AAED,wBAAgB,iBAAiB;;;oBAnWb,MAAM,MAAM,MAAM;;;;;;;6BA6UT,MAAM;KA0BlC"}
package/dist/index.js CHANGED
@@ -159,6 +159,20 @@ export function webjourneyElementTagger() {
159
159
  modified = true;
160
160
  }
161
161
  }
162
+ // Handle all remaining div elements as 'frame' type
163
+ // This catches divs that weren't marked by other conditions
164
+ if (tagName === 'div') {
165
+ // Check again if data-wj-file was added by previous conditions
166
+ const hasDataWjNow = openingElement.attributes.some((attr) => t.isJSXAttribute(attr) &&
167
+ t.isJSXIdentifier(attr.name) &&
168
+ attr.name.name === 'data-wj-file');
169
+ if (!hasDataWjNow) {
170
+ // This div wasn't marked by any other condition, mark it as 'frame'
171
+ const elementId = `${relativePath}:${lineNumber}`;
172
+ openingElement.attributes.push(t.jsxAttribute(t.jsxIdentifier('data-wj-file'), t.stringLiteral(relativePath)), t.jsxAttribute(t.jsxIdentifier('data-wj-line'), t.stringLiteral(String(lineNumber))), t.jsxAttribute(t.jsxIdentifier('data-wj-type'), t.stringLiteral('frame')), t.jsxAttribute(t.jsxIdentifier('data-wj-id'), t.stringLiteral(elementId)));
173
+ modified = true;
174
+ }
175
+ }
162
176
  }
163
177
  });
164
178
  if (modified) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjourney/vite-plugins",
3
- "version": "1.2.11-0",
3
+ "version": "1.2.12-0",
4
4
  "description": "Vite plugins for Webjourney WYSIWYG editing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",