@crapthings/run3d 0.2.10 → 0.2.11
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 +1 -1
- package/template/index.html +1 -1
- package/template/src/main.jsx +16 -0
- package/template/src/styles.css +10 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.11",
|
|
7
7
|
"description": "From idea to interactive 3D prototype in one command. A JavaScript starter with Vite, React Three Fiber, and tools for creative experimentation.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
package/template/index.html
CHANGED
package/template/src/main.jsx
CHANGED
|
@@ -4,6 +4,22 @@ import { createRoot } from 'react-dom/client'
|
|
|
4
4
|
import { App } from '@/App'
|
|
5
5
|
import '@/styles.css'
|
|
6
6
|
|
|
7
|
+
// Keep Tab available to game controls without moving focus outside editable fields.
|
|
8
|
+
function preventTabFocus (event) {
|
|
9
|
+
if (event.key !== 'Tab') return
|
|
10
|
+
if (!(event.target instanceof window.Element)) return
|
|
11
|
+
if (event.target.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"]')) return
|
|
12
|
+
event.preventDefault()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
window.addEventListener('keydown', preventTabFocus)
|
|
16
|
+
|
|
17
|
+
if (import.meta.hot) {
|
|
18
|
+
import.meta.hot.dispose(() => {
|
|
19
|
+
window.removeEventListener('keydown', preventTabFocus)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
7
23
|
createRoot(document.getElementById('root')).render(
|
|
8
24
|
<StrictMode>
|
|
9
25
|
<App />
|