one 1.4.7 → 1.4.9

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.
@@ -263,35 +263,43 @@
263
263
  function setupKeyboard() {
264
264
  if (keyboardSetup) return
265
265
  keyboardSetup = true
266
- document.addEventListener('keydown', (e) => {
267
- if (e.altKey && e.code === 'Space') {
268
- e.preventDefault()
269
- toggleSpotlight()
270
- } else if (e.altKey) {
271
- if (e.code === 'KeyI') {
266
+ // use capture: false so app handlers can preventDefault first
267
+ document.addEventListener(
268
+ 'keydown',
269
+ (e) => {
270
+ // respect other handlers and browser shortcuts
271
+ if (e.defaultPrevented || e.metaKey || e.ctrlKey) return
272
+
273
+ if (e.altKey && e.code === 'Space') {
272
274
  e.preventDefault()
273
- hideSpotlight()
274
- window.__oneSourceInspector?.activate()
275
- return
276
- }
277
- const tabMap = {
278
- KeyS: 'seo',
279
- KeyR: 'route',
280
- KeyL: 'loader',
281
- KeyE: 'errors',
282
- }
283
- const tab = tabMap[e.code]
284
- if (tab) {
285
- e.preventDefault()
286
- activeTab = tab
287
- hideSpotlight()
288
- showPanel()
275
+ toggleSpotlight()
276
+ } else if (e.altKey) {
277
+ if (e.code === 'KeyI') {
278
+ e.preventDefault()
279
+ hideSpotlight()
280
+ window.__oneSourceInspector?.activate()
281
+ return
282
+ }
283
+ const tabMap = {
284
+ KeyS: 'seo',
285
+ KeyR: 'route',
286
+ KeyL: 'loader',
287
+ KeyE: 'errors',
288
+ }
289
+ const tab = tabMap[e.code]
290
+ if (tab) {
291
+ e.preventDefault()
292
+ activeTab = tab
293
+ hideSpotlight()
294
+ showPanel()
295
+ }
296
+ } else if (e.code === 'Escape') {
297
+ if (spotlightDialog?.open) spotlightDialog.close()
298
+ else if (panelDialog?.open) panelDialog.close()
289
299
  }
290
- } else if (e.code === 'Escape') {
291
- if (spotlightDialog?.open) spotlightDialog.close()
292
- else if (panelDialog?.open) panelDialog.close()
293
- }
294
- })
300
+ },
301
+ { capture: false }
302
+ )
295
303
  }
296
304
 
297
305
  function toggleSpotlight() {
@@ -238,7 +238,7 @@ if (typeof document === 'undefined') globalThis.document = {}
238
238
  `),
239
239
  deferredLinks = (deferredPreloads || []).map(preload => ` <link rel="modulepreload" fetchPriority="low" href="${preload}"/>`).join(`
240
240
  `);
241
- await outputFile(htmlOutPath, `<html><head>
241
+ await outputFile(htmlOutPath, `<!DOCTYPE html><html><head>
242
242
  ${constants.getSpaHeaderElements({
243
243
  serverContext: {
244
244
  loaderProps,
@@ -217,7 +217,7 @@ if (typeof document === 'undefined') globalThis.document = {}
217
217
  `);
218
218
  await outputFile(
219
219
  htmlOutPath,
220
- `<html><head>
220
+ `<!DOCTYPE html><html><head>
221
221
  ${constants.getSpaHeaderElements({ serverContext: { loaderProps, loaderData } })}
222
222
  ${criticalScripts}
223
223
  ${deferredLinks}
@@ -309,7 +309,7 @@ if (typeof document === 'undefined') globalThis.document = {}
309
309
  return ` <link rel="modulepreload" fetchPriority="low" href="${preload}"/>`;
310
310
  }).join(`
311
311
  `);
312
- await outputFile(htmlOutPath, `<html><head>
312
+ await outputFile(htmlOutPath, `<!DOCTYPE html><html><head>
313
313
  ${constants.getSpaHeaderElements({
314
314
  serverContext: {
315
315
  loaderProps,
@@ -68,7 +68,7 @@ function createFileSystemRouterPlugin(options) {
68
68
  url,
69
69
  loaderProps
70
70
  }) {
71
- if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<html><head>
71
+ if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<!DOCTYPE html><html><head>
72
72
  ${(0, import_constants.getSpaHeaderElements)({
73
73
  serverContext: {
74
74
  mode: "spa"
@@ -41,7 +41,7 @@ function createFileSystemRouterPlugin(options) {
41
41
  if (console.info(
42
42
  ` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`
43
43
  ), route.type === "spa")
44
- return `<html><head>
44
+ return `<!DOCTYPE html><html><head>
45
45
  ${(0, import_constants.getSpaHeaderElements)({ serverContext: { mode: "spa" } })}
46
46
  <script type="module" src="/@one/dev.js"></script>
47
47
  <script type="module" src="/@vite/client" async=""></script>
@@ -80,7 +80,7 @@ function createFileSystemRouterPlugin(options) {
80
80
  url,
81
81
  loaderProps
82
82
  } = param;
83
- if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<html><head>
83
+ if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<!DOCTYPE html><html><head>
84
84
  ${(0, import_constants.getSpaHeaderElements)({
85
85
  serverContext: {
86
86
  mode: "spa"
@@ -195,7 +195,7 @@ if (typeof document === 'undefined') globalThis.document = {}
195
195
  `);
196
196
  await outputFile(
197
197
  htmlOutPath,
198
- `<html><head>
198
+ `<!DOCTYPE html><html><head>
199
199
  ${constants.getSpaHeaderElements({ serverContext: { loaderProps, loaderData } })}
200
200
  ${criticalScripts}
201
201
  ${deferredLinks}
@@ -201,7 +201,7 @@ if (typeof document === 'undefined') globalThis.document = {}
201
201
  `),
202
202
  deferredLinks = (deferredPreloads || []).map(preload => ` <link rel="modulepreload" fetchPriority="low" href="${preload}"/>`).join(`
203
203
  `);
204
- await outputFile(htmlOutPath, `<html><head>
204
+ await outputFile(htmlOutPath, `<!DOCTYPE html><html><head>
205
205
  ${constants.getSpaHeaderElements({
206
206
  serverContext: {
207
207
  loaderProps,
@@ -270,7 +270,7 @@ if (typeof document === 'undefined') globalThis.document = {}
270
270
  return ` <link rel="modulepreload" fetchPriority="low" href="${preload}"/>`;
271
271
  }).join(`
272
272
  `);
273
- await outputFile(htmlOutPath, `<html><head>
273
+ await outputFile(htmlOutPath, `<!DOCTYPE html><html><head>
274
274
  ${constants.getSpaHeaderElements({
275
275
  serverContext: {
276
276
  loaderProps,
@@ -29,7 +29,7 @@ function createFileSystemRouterPlugin(options) {
29
29
  if (console.info(
30
30
  ` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`
31
31
  ), route.type === "spa")
32
- return `<html><head>
32
+ return `<!DOCTYPE html><html><head>
33
33
  ${getSpaHeaderElements({ serverContext: { mode: "spa" } })}
34
34
  <script type="module" src="/@one/dev.js"></script>
35
35
  <script type="module" src="/@vite/client" async=""></script>
@@ -32,7 +32,7 @@ function createFileSystemRouterPlugin(options) {
32
32
  url,
33
33
  loaderProps
34
34
  }) {
35
- if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<html><head>
35
+ if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<!DOCTYPE html><html><head>
36
36
  ${getSpaHeaderElements({
37
37
  serverContext: {
38
38
  mode: "spa"
@@ -42,7 +42,7 @@ function createFileSystemRouterPlugin(options) {
42
42
  url,
43
43
  loaderProps
44
44
  } = param;
45
- if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<html><head>
45
+ if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.isNotFound ? "\u203C\uFE0F 404 not found" : `app/${route.file.slice(2)}`}`), route.type === "spa") return `<!DOCTYPE html><html><head>
46
46
  ${getSpaHeaderElements({
47
47
  serverContext: {
48
48
  mode: "spa"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "license": "BSD-3-Clause",
5
5
  "sideEffects": [
6
6
  "setup.mjs",
@@ -149,17 +149,17 @@
149
149
  "@react-navigation/routers": "~7.5.1",
150
150
  "@swc/core": "^1.14.0",
151
151
  "@ungap/structured-clone": "^1.2.0",
152
- "@vxrn/color-scheme": "1.4.7",
153
- "@vxrn/compiler": "1.4.7",
154
- "@vxrn/resolve": "1.4.7",
155
- "@vxrn/tslib-lite": "1.4.7",
156
- "@vxrn/use-isomorphic-layout-effect": "1.4.7",
157
- "@vxrn/vite-plugin-metro": "1.4.7",
152
+ "@vxrn/color-scheme": "1.4.9",
153
+ "@vxrn/compiler": "1.4.9",
154
+ "@vxrn/resolve": "1.4.9",
155
+ "@vxrn/tslib-lite": "1.4.9",
156
+ "@vxrn/use-isomorphic-layout-effect": "1.4.9",
157
+ "@vxrn/vite-plugin-metro": "1.4.9",
158
158
  "babel-dead-code-elimination": "1.0.10",
159
159
  "babel-plugin-module-resolver": "^5.0.2",
160
160
  "citty": "^0.1.6",
161
161
  "core-js": "^3.38.1",
162
- "create-vxrn": "1.4.7",
162
+ "create-vxrn": "1.4.9",
163
163
  "escape-string-regexp": "^5.0.0",
164
164
  "expo-linking": "~8.0.8",
165
165
  "expo-modules-core": "~3.0.24",
@@ -185,7 +185,7 @@
185
185
  "vite": "^7.1.12",
186
186
  "vite-plugin-barrel": "^0.4.1",
187
187
  "vite-tsconfig-paths": "^5.1.4",
188
- "vxrn": "1.4.7",
188
+ "vxrn": "1.4.9",
189
189
  "ws": "^8.18.0",
190
190
  "xxhashjs": "^0.2.2"
191
191
  },
@@ -321,7 +321,7 @@ if (typeof document === 'undefined') globalThis.document = {}
321
321
 
322
322
  await outputFile(
323
323
  htmlOutPath,
324
- `<html><head>
324
+ `<!DOCTYPE html><html><head>
325
325
  ${constants.getSpaHeaderElements({ serverContext: { loaderProps, loaderData } })}
326
326
  ${criticalScripts}
327
327
  ${deferredLinks}
@@ -53,7 +53,7 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
53
53
 
54
54
  if (route.type === 'spa') {
55
55
  // render just the layouts? route.layouts
56
- return `<html><head>
56
+ return `<!DOCTYPE html><html><head>
57
57
  ${getSpaHeaderElements({ serverContext: { mode: 'spa' } })}
58
58
  <script type="module" src="/@one/dev.js"></script>
59
59
  <script type="module" src="/@vite/client" async=""></script>