cluso-inspector 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/main.js +16 -0
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -100,6 +100,22 @@ ipcMain.handle('extraction-complete', async (event, data) => {
100
100
  const outputPath = process.argv[3] || '/tmp/clonereact-output-' + process.pid + '.json';
101
101
  const language = process.argv[4] || 'typescript';
102
102
 
103
+ // Save screenshot as separate file
104
+ let screenshotPath = null;
105
+ if (data.extractions && data.extractions[0] && data.extractions[0].screenshot) {
106
+ const base64Data = data.extractions[0].screenshot.replace(/^data:image\/png;base64,/, '');
107
+ screenshotPath = outputPath.replace('.json', '-screenshot.png');
108
+ try {
109
+ fs.writeFileSync(screenshotPath, Buffer.from(base64Data, 'base64'));
110
+ console.log('[CloneReact] Screenshot saved:', screenshotPath);
111
+ // Replace base64 with path in output
112
+ data.extractions[0].screenshotPath = screenshotPath;
113
+ delete data.extractions[0].screenshot;
114
+ } catch (error) {
115
+ console.error('[CloneReact] Failed to save screenshot:', error);
116
+ }
117
+ }
118
+
103
119
  // Add language to output
104
120
  const outputData = {
105
121
  ...data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cluso-inspector",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Visual element selector for extracting HTML and screenshots from websites",
5
5
  "main": "main.js",
6
6
  "bin": {