@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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.10",
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": {
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" href="%BASE_URL%favicon.svg" type="image/svg+xml" />
9
9
  <title>Run3D</title>
10
10
  </head>
11
- <body>
11
+ <body class="select-none">
12
12
  <div id="root"></div>
13
13
  <script type="module" src="/src/main.jsx"></script>
14
14
  </body>
@@ -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 />
@@ -1 +1,11 @@
1
1
  @import "tailwindcss";
2
+
3
+ @layer base {
4
+ body {
5
+ -webkit-tap-highlight-color: transparent;
6
+ }
7
+
8
+ :focus {
9
+ @apply outline-none ring-0;
10
+ }
11
+ }