@elixpo/lixsketch 4.6.0 → 4.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elixpo/lixsketch",
3
- "version": "4.6.0",
3
+ "version": "4.6.2",
4
4
  "description": "Open-source SVG whiteboard engine with hand-drawn aesthetics — the core of LixSketch",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -36,11 +36,11 @@
36
36
  "homepage": "https://sketch.elixpo.com",
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/elixpo/elixposketch.git",
40
- "directory": "packages/engine"
39
+ "url": "https://github.com/elixpo/lixsketch.git",
40
+ "directory": "packages/lixsketch"
41
41
  },
42
42
  "bugs": {
43
- "url": "https://github.com/elixpo/elixposketch/issues"
43
+ "url": "https://github.com/elixpo/lixsketch/issues"
44
44
  },
45
45
  "dependencies": {
46
46
  "roughjs": "^4.6.6",
@@ -358,10 +358,12 @@ export function loadScene(sceneData) {
358
358
  }
359
359
  });
360
360
 
361
- window.shapes = [];
361
+ // Clear arrays IN PLACE — tool modules hold direct references to these
362
+ // arrays from import-time, so replacing them breaks interactivity.
363
+ if (window.shapes) window.shapes.length = 0; else window.shapes = [];
362
364
  window.currentShape = null;
363
- window.historyStack = [];
364
- window.redoStack = [];
365
+ if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];
366
+ if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];
365
367
 
366
368
  // Build ID -> shape map for frame containment and arrow attachments
367
369
  const idMap = new Map();
@@ -687,10 +689,11 @@ export function resetCanvas() {
687
689
  '.selection-outline, .resize-anchor, .rotation-anchor, [data-selection]'
688
690
  ).forEach(el => el.remove());
689
691
 
690
- window.shapes = [];
692
+ // Clear arrays IN PLACE (same reason as loadScene)
693
+ if (window.shapes) window.shapes.length = 0; else window.shapes = [];
691
694
  window.currentShape = null;
692
- window.historyStack = [];
693
- window.redoStack = [];
695
+ if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];
696
+ if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];
694
697
 
695
698
  if (typeof window.clearAllSelections === 'function') {
696
699
  window.clearAllSelections();