cyclecad 3.9.2 → 3.9.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.
- package/app/index.html +31 -66
- package/fix-splash-v2.sh +123 -0
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -1310,61 +1310,28 @@
|
|
|
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
|
|
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
|
|
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 · 12 killer features · 46 modules · <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;">✏️</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
|
|
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;">📂</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
|
|
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;">🤖</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
|
|
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;">🏭</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>
|
|
@@ -1373,6 +1340,19 @@
|
|
|
1373
1340
|
<div style="color:#666;font-size:11px;">v0.9.0 · 12 killer features · 46 modules · <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
|
+
document.getElementById('welcome-panel').style.display = 'none';
|
|
1346
|
+
if (action === 'sketch') {
|
|
1347
|
+
// Will be handled by module script once loaded
|
|
1348
|
+
window._pendingSplashAction = 'sketch-new';
|
|
1349
|
+
} else if (action === 'import' || action === 'inventor') {
|
|
1350
|
+
window._pendingSplashAction = 'file-import';
|
|
1351
|
+
} else if (action === 'textcad') {
|
|
1352
|
+
window._pendingSplashAction = 'tools-text-to-cad';
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
</script>
|
|
1376
1356
|
|
|
1377
1357
|
<!-- Modal Dialogs -->
|
|
1378
1358
|
<div id="dialog-overlay" class="modal-overlay">
|
|
@@ -1643,34 +1623,6 @@
|
|
|
1643
1623
|
const statusBar = document.getElementById('status-bar');
|
|
1644
1624
|
const timelineContent = document.getElementById('timeline-content');
|
|
1645
1625
|
|
|
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
1626
|
// ===== Menu Actions Handler =====
|
|
1675
1627
|
function handleMenuAction(action) {
|
|
1676
1628
|
switch (action) {
|
|
@@ -1807,6 +1759,19 @@
|
|
|
1807
1759
|
}
|
|
1808
1760
|
}
|
|
1809
1761
|
|
|
1762
|
+
// ===== Handle pending splash action =====
|
|
1763
|
+
if (window._pendingSplashAction) {
|
|
1764
|
+
const pa = window._pendingSplashAction;
|
|
1765
|
+
window._pendingSplashAction = null;
|
|
1766
|
+
handleMenuAction(pa);
|
|
1767
|
+
}
|
|
1768
|
+
// Process splash actions dispatched after module load
|
|
1769
|
+
Object.defineProperty(window, '_pendingSplashAction', {
|
|
1770
|
+
set(v) { if (v) { setTimeout(() => handleMenuAction(v), 100); } },
|
|
1771
|
+
get() { return null; },
|
|
1772
|
+
configurable: true
|
|
1773
|
+
});
|
|
1774
|
+
|
|
1810
1775
|
// ===== Workspace Switching =====
|
|
1811
1776
|
workspaceTabs.forEach(tab => {
|
|
1812
1777
|
tab.addEventListener('click', (e) => {
|
package/fix-splash-v2.sh
ADDED
|
@@ -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;">✏️</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;">📂</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;">🤖</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;">🏭</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 · 12 killer features · 46 modules · <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