cyclecad 3.9.2 → 3.9.4

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/app/index.html CHANGED
@@ -1310,69 +1310,53 @@
1310
1310
 
1311
1311
  <!-- Welcome Splash Screen -->
1312
1312
  <div id="welcome-panel" style="position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.75);display:flex;align-items:center;justify-content:center;z-index:9999;">
1313
- <div style="background:var(--bg-secondary,#252526);border:1px solid var(--border-color,#3c3c3c);border-radius:12px;padding:40px 48px;max-width:560px;width:90%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,0.5);">
1313
+ <div style="background:#252526;border:1px solid #3c3c3c;border-radius:12px;padding:40px 48px;max-width:560px;width:90%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,0.5);">
1314
1314
  <div style="font-size:36px;margin-bottom:4px;">
1315
1315
  <span style="color:#0284C7;font-weight:700;">cycle</span><span style="color:#e0e0e0;font-weight:300;">CAD</span>
1316
1316
  </div>
1317
1317
  <div style="color:#888;font-size:13px;margin-bottom:28px;">Agent-First Parametric 3D CAD Modeler</div>
1318
1318
  <div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;">
1319
- <button data-action="new-sketch" style="background:#0284C7;color:#fff;border:none;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;transition:background 0.2s;" onmouseover="this.style.background='#0369a1'" onmouseout="this.style.background='#0284C7'">
1320
- <div style="font-size:24px;margin-bottom:6px;">✏️</div>
1321
- New Sketch
1322
- <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Start with a 2D sketch</div>
1323
- </button>
1324
- <button data-action="import" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;transition:background 0.2s;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1325
- <div style="font-size:24px;margin-bottom:6px;">📂</div>
1326
- Open / Import
1327
- <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">STEP, STL, Inventor, JSON</div>
1328
- </button>
1329
- <button data-action="ai-generate" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;transition:background 0.2s;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1330
- <div style="font-size:24px;margin-bottom:6px;">🤖</div>
1331
- Text-to-CAD
1332
- <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Describe a part in English</div>
1333
- </button>
1334
- <button data-action="load-inventor" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;transition:background 0.2s;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1335
- <div style="font-size:24px;margin-bottom:6px;">🏭</div>
1336
- Inventor Project
1337
- <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Load .ipj / .ipt / .iam</div>
1338
- </button>
1339
- </div>
1340
- <div style="color:#666;font-size:11px;">v0.9.0 &middot; 12 killer features &middot; 46 modules &middot; <a href="https://github.com/vvlars-cmd/cyclecad" target="_blank" style="color:#0284C7;text-decoration:none;">GitHub</a></div>
1341
- </div>
1342
- </div>
1343
-
1344
- <!-- Welcome Splash Screen -->
1345
- <div id="welcome-panel" style="position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.75);display:flex;align-items:center;justify-content:center;z-index:9999;">
1346
- <div style="background:var(--bg-secondary,#252526);border:1px solid var(--border-color,#3c3c3c);border-radius:12px;padding:40px 48px;max-width:560px;width:90%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,0.5);">
1347
- <div style="font-size:36px;margin-bottom:4px;">
1348
- <span style="color:#0284C7;font-weight:700;">cycle</span><span style="color:#e0e0e0;font-weight:300;">CAD</span>
1349
- </div>
1350
- <div style="color:#888;font-size:13px;margin-bottom:28px;">Agent-First Parametric 3D CAD Modeler</div>
1351
- <div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;">
1352
- <button data-action="new-sketch" style="background:#0284C7;color:#fff;border:none;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;" onmouseover="this.style.background='#0369a1'" onmouseout="this.style.background='#0284C7'">
1319
+ <button onclick="window._dismissSplash('sketch')" style="background:#0284C7;color:#fff;border:none;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
1353
1320
  <div style="font-size:24px;margin-bottom:6px;">&#9999;&#65039;</div>
1354
1321
  New Sketch
1355
1322
  <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Start with a 2D sketch</div>
1356
1323
  </button>
1357
- <button data-action="import" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1324
+ <button onclick="window._dismissSplash('import')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
1358
1325
  <div style="font-size:24px;margin-bottom:6px;">&#128194;</div>
1359
1326
  Open / Import
1360
1327
  <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">STEP, STL, Inventor, JSON</div>
1361
1328
  </button>
1362
- <button data-action="ai-generate" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1329
+ <button onclick="window._dismissSplash('textcad')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
1363
1330
  <div style="font-size:24px;margin-bottom:6px;">&#129302;</div>
1364
1331
  Text-to-CAD
1365
1332
  <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Describe a part in English</div>
1366
1333
  </button>
1367
- <button data-action="load-inventor" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;" onmouseover="this.style.background='#4b5563'" onmouseout="this.style.background='#374151'">
1334
+ <button onclick="window._dismissSplash('inventor')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
1368
1335
  <div style="font-size:24px;margin-bottom:6px;">&#127981;</div>
1369
1336
  Inventor Project
1370
1337
  <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Load .ipj / .ipt / .iam</div>
1371
1338
  </button>
1372
1339
  </div>
1373
- <div style="color:#666;font-size:11px;">v0.9.0 &middot; 12 killer features &middot; 46 modules &middot; <a href="https://github.com/vvlars-cmd/cyclecad" target="_blank" style="color:#0284C7;text-decoration:none;">GitHub</a></div>
1340
+ <div style="color:#666;font-size:11px;"><span id="splash-version">v0.9.0</span> &middot; 12 killer features &middot; 46 modules &middot; <a href="https://github.com/vvlars-cmd/cyclecad" target="_blank" style="color:#0284C7;text-decoration:none;">GitHub</a></div>
1374
1341
  </div>
1375
1342
  </div>
1343
+ <script>
1344
+ window._dismissSplash = function(action) {
1345
+ // Update splash version from status bar
1346
+ var sv = document.getElementById('splash-version');
1347
+ var sb = document.querySelector('[class*="status"]');
1348
+ if (sv && sb) { var m = sb.textContent.match(/v[\d.]+/); if (m) sv.textContent = m[0]; }
1349
+ document.getElementById('welcome-panel').style.display = 'none';
1350
+ if (action === 'sketch') {
1351
+ // Will be handled by module script once loaded
1352
+ window._pendingSplashAction = 'sketch-new';
1353
+ } else if (action === 'import' || action === 'inventor') {
1354
+ window._pendingSplashAction = 'file-import';
1355
+ } else if (action === 'textcad') {
1356
+ window._pendingSplashAction = 'tools-text-to-cad';
1357
+ }
1358
+ };
1359
+ </script>
1376
1360
 
1377
1361
  <!-- Modal Dialogs -->
1378
1362
  <div id="dialog-overlay" class="modal-overlay">
@@ -1643,34 +1627,6 @@
1643
1627
  const statusBar = document.getElementById('status-bar');
1644
1628
  const timelineContent = document.getElementById('timeline-content');
1645
1629
 
1646
- // ===== Welcome Splash =====
1647
- const welcomePanel = document.getElementById('welcome-panel');
1648
- if (welcomePanel) {
1649
- const dismissWelcome = () => { welcomePanel.style.display = 'none'; };
1650
- const wb1 = welcomePanel.querySelector('[data-action="new-sketch"]');
1651
- if (wb1) wb1.onclick = () => { dismissWelcome(); handleMenuAction('sketch-new'); };
1652
- const wb2 = welcomePanel.querySelector('[data-action="import"]');
1653
- if (wb2) wb2.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
1654
- const wb3 = welcomePanel.querySelector('[data-action="ai-generate"]');
1655
- if (wb3) wb3.onclick = () => { dismissWelcome(); handleMenuAction('tools-text-to-cad'); };
1656
- const wb4 = welcomePanel.querySelector('[data-action="load-inventor"]');
1657
- if (wb4) wb4.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
1658
- }
1659
-
1660
- // ===== Welcome Splash =====
1661
- const welcomePanel = document.getElementById('welcome-panel');
1662
- if (welcomePanel) {
1663
- const dismissWelcome = () => { welcomePanel.style.display = 'none'; };
1664
- const wb1 = welcomePanel.querySelector('[data-action="new-sketch"]');
1665
- if (wb1) wb1.onclick = () => { dismissWelcome(); handleMenuAction('sketch-new'); };
1666
- const wb2 = welcomePanel.querySelector('[data-action="import"]');
1667
- if (wb2) wb2.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
1668
- const wb3 = welcomePanel.querySelector('[data-action="ai-generate"]');
1669
- if (wb3) wb3.onclick = () => { dismissWelcome(); handleMenuAction('tools-text-to-cad'); };
1670
- const wb4 = welcomePanel.querySelector('[data-action="load-inventor"]');
1671
- if (wb4) wb4.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
1672
- }
1673
-
1674
1630
  // ===== Menu Actions Handler =====
1675
1631
  function handleMenuAction(action) {
1676
1632
  switch (action) {
@@ -1807,6 +1763,19 @@
1807
1763
  }
1808
1764
  }
1809
1765
 
1766
+ // ===== Handle pending splash action =====
1767
+ if (window._pendingSplashAction) {
1768
+ const pa = window._pendingSplashAction;
1769
+ window._pendingSplashAction = null;
1770
+ handleMenuAction(pa);
1771
+ }
1772
+ // Process splash actions dispatched after module load
1773
+ Object.defineProperty(window, '_pendingSplashAction', {
1774
+ set(v) { if (v) { setTimeout(() => handleMenuAction(v), 100); } },
1775
+ get() { return null; },
1776
+ configurable: true
1777
+ });
1778
+
1810
1779
  // ===== Workspace Switching =====
1811
1780
  workspaceTabs.forEach(tab => {
1812
1781
  tab.addEventListener('click', (e) => {
@@ -0,0 +1,123 @@
1
+ #!/bin/bash
2
+ # Fix splash screen buttons - v2 (uses global onclick + inline handlers)
3
+ # Run from ~/cyclecad: bash fix-splash-v2.sh
4
+
5
+ set -e
6
+ cd "$(dirname "$0")"
7
+
8
+ echo "=== Replacing welcome splash with working version ==="
9
+
10
+ python3 << 'PYEOF'
11
+ with open('app/index.html', 'r') as f:
12
+ content = f.read()
13
+
14
+ # Remove old welcome panel if it exists
15
+ import re
16
+ content = re.sub(
17
+ r'<!-- Welcome Splash Screen -->.*?</div>\s*</div>\s*</div>\s*\n\n',
18
+ '',
19
+ content,
20
+ flags=re.DOTALL
21
+ )
22
+
23
+ # Remove old welcome splash JS wiring if it exists
24
+ content = content.replace(
25
+ """ // ===== Welcome Splash =====
26
+ const welcomePanel = document.getElementById('welcome-panel');
27
+ if (welcomePanel) {
28
+ const dismissWelcome = () => { welcomePanel.style.display = 'none'; };
29
+ const wb1 = welcomePanel.querySelector('[data-action="new-sketch"]');
30
+ if (wb1) wb1.onclick = () => { dismissWelcome(); handleMenuAction('sketch-new'); };
31
+ const wb2 = welcomePanel.querySelector('[data-action="import"]');
32
+ if (wb2) wb2.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
33
+ const wb3 = welcomePanel.querySelector('[data-action="ai-generate"]');
34
+ if (wb3) wb3.onclick = () => { dismissWelcome(); handleMenuAction('tools-text-to-cad'); };
35
+ const wb4 = welcomePanel.querySelector('[data-action="load-inventor"]');
36
+ if (wb4) wb4.onclick = () => { dismissWelcome(); handleMenuAction('file-import'); };
37
+ }
38
+
39
+ """,
40
+ ""
41
+ )
42
+
43
+ # New splash with INLINE onclick handlers that use a global function
44
+ new_splash = '''<!-- Welcome Splash Screen -->
45
+ <div id="welcome-panel" style="position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.75);display:flex;align-items:center;justify-content:center;z-index:9999;">
46
+ <div style="background:#252526;border:1px solid #3c3c3c;border-radius:12px;padding:40px 48px;max-width:560px;width:90%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,0.5);">
47
+ <div style="font-size:36px;margin-bottom:4px;">
48
+ <span style="color:#0284C7;font-weight:700;">cycle</span><span style="color:#e0e0e0;font-weight:300;">CAD</span>
49
+ </div>
50
+ <div style="color:#888;font-size:13px;margin-bottom:28px;">Agent-First Parametric 3D CAD Modeler</div>
51
+ <div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;">
52
+ <button onclick="window._dismissSplash('sketch')" style="background:#0284C7;color:#fff;border:none;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
53
+ <div style="font-size:24px;margin-bottom:6px;">&#9999;&#65039;</div>
54
+ New Sketch
55
+ <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Start with a 2D sketch</div>
56
+ </button>
57
+ <button onclick="window._dismissSplash('import')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
58
+ <div style="font-size:24px;margin-bottom:6px;">&#128194;</div>
59
+ Open / Import
60
+ <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">STEP, STL, Inventor, JSON</div>
61
+ </button>
62
+ <button onclick="window._dismissSplash('textcad')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
63
+ <div style="font-size:24px;margin-bottom:6px;">&#129302;</div>
64
+ Text-to-CAD
65
+ <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Describe a part in English</div>
66
+ </button>
67
+ <button onclick="window._dismissSplash('inventor')" style="background:#374151;color:#fff;border:1px solid #4b5563;border-radius:8px;padding:18px 16px;cursor:pointer;font-size:14px;font-weight:600;">
68
+ <div style="font-size:24px;margin-bottom:6px;">&#127981;</div>
69
+ Inventor Project
70
+ <div style="font-size:11px;font-weight:400;color:rgba(255,255,255,0.7);margin-top:4px;">Load .ipj / .ipt / .iam</div>
71
+ </button>
72
+ </div>
73
+ <div style="color:#666;font-size:11px;">v0.9.0 &middot; 12 killer features &middot; 46 modules &middot; <a href="https://github.com/vvlars-cmd/cyclecad" target="_blank" style="color:#0284C7;text-decoration:none;">GitHub</a></div>
74
+ </div>
75
+ </div>
76
+ <script>
77
+ window._dismissSplash = function(action) {
78
+ document.getElementById('welcome-panel').style.display = 'none';
79
+ if (action === 'sketch') {
80
+ // Will be handled by module script once loaded
81
+ window._pendingSplashAction = 'sketch-new';
82
+ } else if (action === 'import' || action === 'inventor') {
83
+ window._pendingSplashAction = 'file-import';
84
+ } else if (action === 'textcad') {
85
+ window._pendingSplashAction = 'tools-text-to-cad';
86
+ }
87
+ };
88
+ </script>
89
+
90
+ '''
91
+
92
+ # Insert before modal dialogs
93
+ content = content.replace('<!-- Modal Dialogs -->', new_splash + '<!-- Modal Dialogs -->')
94
+
95
+ # Add pending action handler inside the module script, right after menu handler definition
96
+ # Find the end of handleMenuAction and add a check for pending splash action
97
+ old_menu_end = " // ===== Workspace Switching ====="
98
+ new_menu_end = """ // ===== Handle pending splash action =====
99
+ if (window._pendingSplashAction) {
100
+ const pa = window._pendingSplashAction;
101
+ window._pendingSplashAction = null;
102
+ handleMenuAction(pa);
103
+ }
104
+ // Process splash actions dispatched after module load
105
+ Object.defineProperty(window, '_pendingSplashAction', {
106
+ set(v) { if (v) { setTimeout(() => handleMenuAction(v), 100); } },
107
+ get() { return null; },
108
+ configurable: true
109
+ });
110
+
111
+ // ===== Workspace Switching ====="""
112
+
113
+ content = content.replace(old_menu_end, new_menu_end, 1)
114
+
115
+ with open('app/index.html', 'w') as f:
116
+ f.write(content)
117
+
118
+ print('Splash v2 applied successfully!')
119
+ PYEOF
120
+
121
+ echo ""
122
+ echo "=== Done! Now run: ==="
123
+ echo " git add app/index.html && git commit -m 'Fix splash buttons with global onclick handlers' && git push origin main"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyclecad",
3
- "version": "3.9.2",
3
+ "version": "3.9.4",
4
4
  "description": "Browser-based parametric 3D CAD modeler with AI-powered tools, native Inventor file parsing, and smart assembly management. No install required.",
5
5
  "main": "index.html",
6
6
  "bin": {