draply-dev 1.4.2 → 1.4.3

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/bin/cli.js +9 -0
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -211,6 +211,15 @@ const server = http.createServer((req, res) => {
211
211
  if (ctxEnd === -1 || e > ctxEnd) ctxEnd = e;
212
212
  }
213
213
  }
214
+ if (ctxStart === -1 && items.some(c => c.type === 'create')) {
215
+ for (let i = lines.length - 1; i >= 0; i--) {
216
+ if (lines[i].includes('</body>')) {
217
+ ctxStart = Math.max(0, i - 20);
218
+ ctxEnd = Math.min(lines.length - 1, i + 20);
219
+ break;
220
+ }
221
+ }
222
+ }
214
223
  if (ctxStart === -1) { ctxStart = 0; ctxEnd = Math.min(lines.length - 1, 150); }
215
224
 
216
225
  const snippet = lines.slice(ctxStart, ctxEnd + 1).join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draply-dev",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Visual overlay for any frontend project — move, resize, restyle live in the browser, save to CSS",
5
5
  "author": "Arman",
6
6
  "type": "commonjs",