@nuxt/devtools-nightly 2.4.0-29119087.161e847 → 2.5.0-beta.1-29150232.af7da96

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.
Files changed (147) hide show
  1. package/dist/chunks/module-main.mjs +16 -54
  2. package/dist/chunks/vscode.mjs +1 -1
  3. package/dist/client/200.html +23 -23
  4. package/dist/client/404.html +23 -23
  5. package/dist/client/_nuxt/__blank-mumgdw29.js +1 -0
  6. package/dist/client/_nuxt/analyze-build-j0wfoyxs.js +1 -0
  7. package/dist/client/_nuxt/assets-f2bunux0.js +16 -0
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/2c25b256-29c6-425a-bf76-621027b877a5.json +1 -0
  10. package/dist/client/_nuxt/{client-jvnhv8ra.js → client-jlcyzfwz.js} +1 -1
  11. package/dist/client/_nuxt/code-diff.vue-hj7e3t5c.js +8 -0
  12. package/dist/client/_nuxt/code-snippets.vue-jjmq0acf.js +1 -0
  13. package/dist/client/_nuxt/components-c6gzzmvo.js +1 -0
  14. package/dist/client/_nuxt/composable-item.vue-kl41e968.js +1 -0
  15. package/dist/client/_nuxt/{custom-_name_-ofn5ocun.js → custom-_name_-kwo3vonv.js} +1 -1
  16. package/dist/client/_nuxt/data-schema-button.vue-jmetjfac.js +1 -0
  17. package/dist/client/_nuxt/{data-schema-drawer-jzbg0sti.js → data-schema-drawer-l6mz652d.js} +2 -2
  18. package/dist/client/_nuxt/debug-fgttm1no.js +1 -0
  19. package/dist/client/_nuxt/{default-cqdp29y7.js → default-dhaai45p.js} +1 -1
  20. package/dist/client/_nuxt/{duration-display.vue-hy8s2ai6.js → duration-display.vue-l7hutejt.js} +1 -1
  21. package/dist/client/_nuxt/entry.css-gmgc8zz6.css +1 -0
  22. package/dist/client/_nuxt/{error-404-d24rglqw.js → error-404-nf9bohnx.js} +1 -1
  23. package/dist/client/_nuxt/error-404.css-elh6uwdu.css +1 -0
  24. package/dist/client/_nuxt/{error-500-f8x6klpm.js → error-500-fresoenl.js} +1 -1
  25. package/dist/client/_nuxt/error-500.css-bxkdntg7.css +1 -0
  26. package/dist/client/_nuxt/{error-gqxqb2bl.js → error-exr6hsif.js} +5 -5
  27. package/dist/client/_nuxt/{filepath-item.vue-es4nd5ah.js → filepath-item.vue-e3e8lc21.js} +1 -1
  28. package/dist/client/_nuxt/fjteu286.js +15 -0
  29. package/dist/client/_nuxt/full-j15nryr5.js +1 -0
  30. package/dist/client/_nuxt/{help-fab.vue-np1qjy19.js → help-fab.vue-bs6lnv4o.js} +1 -1
  31. package/dist/client/_nuxt/hooks-fn6cgaow.js +1 -0
  32. package/dist/client/_nuxt/{imports-dxtru5qm.js → imports-d8g6axx0.js} +1 -1
  33. package/dist/client/_nuxt/index-md0rh7cv.js +1 -0
  34. package/dist/client/_nuxt/launch-page.vue-km22gdvy.js +1 -0
  35. package/dist/client/_nuxt/modules-f5pax97e.js +1 -0
  36. package/dist/client/_nuxt/nbadge-hqyt05iy.js +1 -0
  37. package/dist/client/_nuxt/ncheckbox.vue-gj0kx6a4.js +1 -0
  38. package/dist/client/_nuxt/{ncode-block.vue-8qivpy1q.js → ncode-block.vue-lge6rogf.js} +1 -1
  39. package/dist/client/_nuxt/{ndrawer.vue-inh3ku0x.js → ndrawer.vue-ddajx96d.js} +1 -1
  40. package/dist/client/_nuxt/ndropdown.vue-f7ef4m62.js +1 -0
  41. package/dist/client/_nuxt/nicon-title.vue-d27ih16g.js +1 -0
  42. package/dist/client/_nuxt/{nlink.vue-m5q8gcph.js → nlink.vue-k2cnmdqj.js} +1 -1
  43. package/dist/client/_nuxt/nmarkdown.vue-isat7p33.js +1 -0
  44. package/dist/client/_nuxt/{nnavbar.vue-yxq5vgdd.js → nnavbar.vue-cntb7jtz.js} +1 -1
  45. package/dist/client/_nuxt/none-eh8hc9e6.js +1 -0
  46. package/dist/client/_nuxt/nsection-block-ngi8459h.js +1 -0
  47. package/dist/client/_nuxt/nselect-tabs.vue-hs2i1hpf.js +1 -0
  48. package/dist/client/_nuxt/{nselect.vue-oss0jirl.js → nselect.vue-nlnlb2ys.js} +1 -1
  49. package/dist/client/_nuxt/{nswitch.vue-n63sh5rf.js → nswitch.vue-f07mzo8x.js} +1 -1
  50. package/dist/client/_nuxt/open-graph-b3edvyuu.js +3 -0
  51. package/dist/client/_nuxt/overview-knttopqz.js +1 -0
  52. package/dist/client/_nuxt/pages-l14g5nzp.js +1 -0
  53. package/dist/client/_nuxt/payload-kgp1vtk1.js +1 -0
  54. package/dist/client/_nuxt/pinia-i4vpuxo0.js +1 -0
  55. package/dist/client/_nuxt/plugins-ei8a4gwh.js +1 -0
  56. package/dist/client/_nuxt/render-tree-jaw4w13c.js +1 -0
  57. package/dist/client/_nuxt/{runtime-configs-oh4k84k2.js → runtime-configs-h1uncakq.js} +1 -1
  58. package/dist/client/_nuxt/{server-discovery-jaawdsj9.js → server-discovery-i4b0arzv.js} +1 -1
  59. package/dist/client/_nuxt/{server-route-inputs.vue-fu0w0hjx.js → server-route-inputs.vue-n4w96mn8.js} +1 -1
  60. package/dist/client/_nuxt/{server-routes-orf48vz1.js → server-routes-ozf5e5sy.js} +2 -2
  61. package/dist/client/_nuxt/server-tasks-gnhguq20.js +1 -0
  62. package/dist/client/_nuxt/settings-kadfhy6q.js +1 -0
  63. package/dist/client/_nuxt/{stacktrace-list.vue-diakeg9o.js → stacktrace-list.vue-mh6wzuwj.js} +1 -1
  64. package/dist/client/_nuxt/{state-components-dw3sauyf.js → state-components-km9k1k2j.js} +1 -1
  65. package/dist/client/_nuxt/state-editor.vue-novkwx2d.js +1 -0
  66. package/dist/client/_nuxt/state-modules-ccot1z8v.js +1 -0
  67. package/dist/client/_nuxt/storage-kookwd8h.js +1 -0
  68. package/dist/client/_nuxt/terminals-opuzmx1u.js +1 -0
  69. package/dist/client/_nuxt/{timeline-bljopo1k.js → timeline-o22pyt14.js} +2 -2
  70. package/dist/client/_nuxt/{unocss-runtime-kct8zzpi.js → unocss-runtime-n76zvjc0.js} +1 -1
  71. package/dist/client/_nuxt/vendor/json-editor-vue-pb6xqf2y.js +3857 -0
  72. package/dist/client/_nuxt/vendor/{quicktype-core-d6crrn92.js → quicktype-core-lhaz4hgj.js} +57 -57
  73. package/dist/client/_nuxt/vendor/shiki-hjqm7vcp.js +152 -0
  74. package/dist/client/_nuxt/vendor/unocss-k776m6tm.js +2 -0
  75. package/dist/client/_nuxt/vendor/{vis-fth2qiu5.js → vis-gqe7ml2e.js} +2 -2
  76. package/dist/client/_nuxt/{virtual-files-nc41y6b5.js → virtual-files-kvzdkk80.js} +1 -1
  77. package/dist/client/_nuxt/vue-devtools-cjz7ko6t.js +2 -0
  78. package/dist/client/_nuxt/{vue-virtual-scroller.esm-iodr444e.js → vue-virtual-scroller.esm-nuoya9vo.js} +2 -2
  79. package/dist/client/index.html +23 -23
  80. package/dist/module.d.mts +1 -1
  81. package/dist/module.json +2 -2
  82. package/dist/module.mjs +1 -1
  83. package/dist/runtime/plugins/view/client.d.ts +2 -1
  84. package/dist/runtime/plugins/view/client.js +57 -28
  85. package/dist/runtime/plugins/view/state.d.ts +1 -3
  86. package/dist/runtime/plugins/view/state.js +0 -3
  87. package/dist/runtime/plugins/view/utils.d.ts +0 -28
  88. package/dist/runtime/plugins/view/utils.js +1 -125
  89. package/dist/runtime/shared/hooks.d.ts +1 -0
  90. package/dist/shared/{devtools-nightly.c069f83f.mjs → devtools-nightly.Dlu0WIXO.mjs} +1 -1
  91. package/dist/types.d.mts +1 -1
  92. package/dist/webcomponents/index.d.mts +20 -0
  93. package/dist/webcomponents/index.mjs +1543 -0
  94. package/package.json +46 -38
  95. package/types.d.ts +1 -1
  96. package/dist/client/_nuxt/__blank-catci4by.js +0 -1
  97. package/dist/client/_nuxt/analyze-build-opipk7q9.js +0 -1
  98. package/dist/client/_nuxt/assets-jv7irxil.js +0 -16
  99. package/dist/client/_nuxt/builds/meta/e9711a2d-ecdf-479b-94de-c1f2312a5b46.json +0 -1
  100. package/dist/client/_nuxt/code-diff.vue-h3z2bs0y.js +0 -8
  101. package/dist/client/_nuxt/code-snippets.vue-ozwaaqi4.js +0 -1
  102. package/dist/client/_nuxt/components-d8htfuj5.js +0 -1
  103. package/dist/client/_nuxt/composable-item.vue-o7shr77p.js +0 -1
  104. package/dist/client/_nuxt/data-schema-button.vue-bobjn36y.js +0 -1
  105. package/dist/client/_nuxt/debug-e73ob7jx.js +0 -1
  106. package/dist/client/_nuxt/entry.css-kd26hpr1.css +0 -1
  107. package/dist/client/_nuxt/error-404.css-itl1ee4a.css +0 -1
  108. package/dist/client/_nuxt/error-500.css-biq96mi6.css +0 -1
  109. package/dist/client/_nuxt/full-okfa2pgg.js +0 -1
  110. package/dist/client/_nuxt/hooks-epk49zwi.js +0 -1
  111. package/dist/client/_nuxt/index-g2ifuy9r.js +0 -1
  112. package/dist/client/_nuxt/k3zrtz5x.js +0 -15
  113. package/dist/client/_nuxt/launch-page.vue-myk75wop.js +0 -1
  114. package/dist/client/_nuxt/modules-inb11uuc.js +0 -1
  115. package/dist/client/_nuxt/nbadge-c7f9e02e.js +0 -1
  116. package/dist/client/_nuxt/ncheckbox.vue-owe6hu8z.js +0 -1
  117. package/dist/client/_nuxt/ndropdown.vue-i1smzpn0.js +0 -1
  118. package/dist/client/_nuxt/nicon-title.vue-m2ftlsrz.js +0 -1
  119. package/dist/client/_nuxt/nmarkdown.vue-hrdikzmp.js +0 -1
  120. package/dist/client/_nuxt/none-mblzlj9f.js +0 -1
  121. package/dist/client/_nuxt/nsection-block-jgcddzy2.js +0 -1
  122. package/dist/client/_nuxt/nselect-tabs.vue-m4lmg5qf.js +0 -1
  123. package/dist/client/_nuxt/open-graph-ku5utn4c.js +0 -3
  124. package/dist/client/_nuxt/overview-mv4ijnuv.js +0 -1
  125. package/dist/client/_nuxt/pages-mg7gm878.js +0 -1
  126. package/dist/client/_nuxt/payload-gv103ld5.js +0 -1
  127. package/dist/client/_nuxt/pinia-maypxdhg.js +0 -1
  128. package/dist/client/_nuxt/plugins-njalbz82.js +0 -1
  129. package/dist/client/_nuxt/render-tree-xz64vb7c.js +0 -1
  130. package/dist/client/_nuxt/server-tasks-nklqi5ly.js +0 -1
  131. package/dist/client/_nuxt/settings-hs7hhsy9.js +0 -1
  132. package/dist/client/_nuxt/state-editor.vue-gp2qshlr.js +0 -1
  133. package/dist/client/_nuxt/state-modules-f1v1j4h2.js +0 -1
  134. package/dist/client/_nuxt/storage-orafpl6t.js +0 -1
  135. package/dist/client/_nuxt/terminals-c4krx6y2.js +0 -1
  136. package/dist/client/_nuxt/vendor/json-editor-vue-exjsfanq.js +0 -3872
  137. package/dist/client/_nuxt/vendor/shiki-hjrnbayr.js +0 -289
  138. package/dist/client/_nuxt/vendor/unocss-n30bmhn8.js +0 -2
  139. package/dist/client/_nuxt/vue-devtools-cl1t0gip.js +0 -2
  140. package/dist/dirs.d.ts +0 -7
  141. package/dist/module.cjs +0 -5
  142. package/dist/module.d.ts +0 -8
  143. package/dist/runtime/plugins/view/FrameBox.vue +0 -167
  144. package/dist/runtime/plugins/view/Main.vue +0 -432
  145. package/dist/shared/devtools-nightly.427ec2e8.d.ts +0 -57
  146. package/dist/types.d.ts +0 -41
  147. /package/dist/shared/{devtools-nightly.427ec2e8.d.mts → devtools-nightly.C1a10l_c.d.mts} +0 -0
package/dist/dirs.d.ts DELETED
@@ -1,7 +0,0 @@
1
- declare const packageDir: string;
2
- declare const distDir: string;
3
- declare const runtimeDir: string;
4
- declare const clientDir: string;
5
- declare function isGlobalInstall(): boolean;
6
-
7
- export { clientDir, distDir, isGlobalInstall, packageDir, runtimeDir };
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import './shared/devtools-nightly.427ec2e8.js';
3
- import { ModuleOptions } from '@nuxt/devtools-kit/types';
4
- export { ModuleOptions } from '@nuxt/devtools-kit/types';
5
-
6
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
-
8
- export { _default as default };
@@ -1,167 +0,0 @@
1
- <script setup lang="ts">
2
- import type { NuxtDevtoolsHostClient } from '@nuxt/devtools/types'
3
- import { ref, watchEffect } from 'vue'
4
- import { PANEL_MAX, PANEL_MIN, popupWindow, state } from './state'
5
- import { useEventListener } from './utils'
6
-
7
- const props = defineProps<{
8
- client: NuxtDevtoolsHostClient
9
- isDragging: boolean
10
- }>()
11
-
12
- const container = ref<HTMLElement>()
13
- const isResizing = ref<false | { top?: boolean, left?: boolean, right?: boolean, bottom?: boolean }>(false)
14
-
15
- watchEffect(() => {
16
- if (!container.value)
17
- return
18
-
19
- if (state.value.open) {
20
- const iframe = props.client.getIframe()
21
- if (!iframe)
22
- return
23
-
24
- iframe.style.pointerEvents = (isResizing.value || props.isDragging || props.client.inspector?.isEnabled.value)
25
- ? 'none'
26
- : 'auto'
27
-
28
- if (!popupWindow.value) {
29
- if (Array.from(container.value.children).every(el => el !== iframe))
30
- container.value.appendChild(iframe)
31
- }
32
- }
33
- })
34
-
35
- useEventListener(window, 'keydown', (e: KeyboardEvent) => {
36
- if (e.key === 'Escape' && props.client.inspector?.isEnabled.value) {
37
- e.preventDefault()
38
- props.client.inspector?.disable()
39
- props.client.devtools.close()
40
- }
41
- })
42
-
43
- // Close panel on outside click (when enabled)
44
- useEventListener(window, 'mousedown', (e: MouseEvent) => {
45
- if (!state.value.closeOnOutsideClick)
46
- return
47
- if (popupWindow.value)
48
- return
49
- if (!state.value.open || isResizing.value || props.client.inspector?.isEnabled.value)
50
- return
51
-
52
- const matched = e.composedPath().find((_el) => {
53
- const el = _el as HTMLElement
54
- return Array.from(el.classList || []).some(c => c.startsWith('nuxt-devtools-'))
55
- || el.tagName?.toLowerCase() === 'iframe'
56
- })
57
-
58
- if (!matched)
59
- state.value.open = false
60
- })
61
-
62
- function handleResize(e: MouseEvent | TouchEvent) {
63
- if (!isResizing.value || !state.value.open)
64
- return
65
-
66
- const iframe = props.client.getIframe()
67
- if (!iframe)
68
- return
69
-
70
- const box = iframe.getBoundingClientRect()
71
-
72
- let widthPx: number, heightPx: number
73
- if (isResizing.value.right) {
74
- widthPx = Math.abs(e instanceof MouseEvent ? e.clientX : (e.touches[0]?.clientX || 0) - (box?.left || 0))
75
- state.value.width = Math.min(PANEL_MAX, Math.max(PANEL_MIN, widthPx / window.innerWidth * 100))
76
- }
77
- else if (isResizing.value.left) {
78
- widthPx = Math.abs((box?.right || 0) - (e instanceof MouseEvent ? e.clientX : (e.touches[0]?.clientX || 0)))
79
- state.value.width = Math.min(PANEL_MAX, Math.max(PANEL_MIN, widthPx / window.innerWidth * 100))
80
- }
81
-
82
- if (isResizing.value.top) {
83
- heightPx = Math.abs((box?.bottom || 0) - (e instanceof MouseEvent ? e.clientY : (e.touches[0]?.clientY || 0)))
84
- state.value.height = Math.min(PANEL_MAX, Math.max(PANEL_MIN, heightPx / window.innerHeight * 100))
85
- }
86
- else if (isResizing.value.bottom) {
87
- heightPx = Math.abs(e instanceof MouseEvent ? e.clientY : (e.touches[0]?.clientY || 0) - (box?.top || 0))
88
- state.value.height = Math.min(PANEL_MAX, Math.max(PANEL_MIN, heightPx / window.innerHeight * 100))
89
- }
90
- }
91
-
92
- useEventListener(window, 'mousemove', handleResize)
93
- useEventListener(window, 'touchmove', handleResize)
94
- useEventListener(window, 'mouseup', () => isResizing.value = false)
95
- useEventListener(window, 'touchend', () => isResizing.value = false)
96
- useEventListener(window, 'mouseleave', () => isResizing.value = false)
97
- </script>
98
-
99
- <template>
100
- <div
101
- v-show="state.open && !client.inspector?.isEnabled.value && !popupWindow"
102
- ref="container"
103
- class="nuxt-devtools-frame"
104
- >
105
- <!-- Handlers -->
106
- <div
107
- v-show="state.position !== 'top'"
108
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-horizontal"
109
- :style="{ top: 0 }"
110
- @mousedown.prevent="isResizing = { top: true }"
111
- @touchstart.passive="() => isResizing = { top: true }"
112
- />
113
- <div
114
- v-show="state.position !== 'bottom'"
115
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-horizontal"
116
- :style="{ bottom: 0 }"
117
- @mousedown.prevent="() => isResizing = { bottom: true }"
118
- @touchstart.passive="() => isResizing = { bottom: true }"
119
- />
120
- <div
121
- v-show="state.position !== 'left'"
122
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-vertical"
123
- :style="{ left: 0 }"
124
- @mousedown.prevent="() => isResizing = { left: true }"
125
- @touchstart.passive="() => isResizing = { left: true }"
126
- />
127
- <div
128
- v-show="state.position !== 'right'"
129
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-vertical"
130
- :style="{ right: 0 }"
131
- @mousedown.prevent="() => isResizing = { right: true }"
132
- @touchstart.passive="() => isResizing = { right: true }"
133
- />
134
- <div
135
- v-show="state.position !== 'top' && state.position !== 'left'"
136
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-corner"
137
- :style="{ top: 0, left: 0, cursor: 'nwse-resize' }"
138
- @mousedown.prevent="() => isResizing = { top: true, left: true }"
139
- @touchstart.passive="() => isResizing = { top: true, left: true }"
140
- />
141
- <div
142
- v-show="state.position !== 'top' && state.position !== 'right'"
143
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-corner"
144
- :style="{ top: 0, right: 0, cursor: 'nesw-resize' }"
145
- @mousedown.prevent="() => isResizing = { top: true, right: true }"
146
- @touchstart.passive="() => isResizing = { top: true, right: true }"
147
- />
148
- <div
149
- v-show="state.position !== 'bottom' && state.position !== 'left'"
150
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-corner"
151
- :style="{ bottom: 0, left: 0, cursor: 'nesw-resize' }"
152
- @mousedown.prevent="() => isResizing = { bottom: true, left: true }"
153
- @touchstart.passive="() => isResizing = { bottom: true, left: true }"
154
- />
155
- <div
156
- v-show="state.position !== 'bottom' && state.position !== 'right'"
157
- class="nuxt-devtools-resize-handle nuxt-devtools-resize-handle-corner"
158
- :style="{ bottom: 0, right: 0, cursor: 'nwse-resize' }"
159
- @mousedown.prevent="() => isResizing = { bottom: true, right: true }"
160
- @touchstart.passive="() => isResizing = { bottom: true, right: true }"
161
- />
162
- </div>
163
- </template>
164
-
165
- <style scoped>
166
- .nuxt-devtools-frame{height:100%;position:fixed;width:100%;z-index:2147483645;-webkit-font-smoothing:antialiased}.nuxt-devtools-frame :deep(iframe){background:var(--nuxt-devtools-widget-bg);border:1px solid hsla(0,0%,49%,.2);border-radius:10px;height:100%;outline:none;width:100%}.nuxt-devtools-resize-handle-horizontal{border-radius:5px;cursor:ns-resize;height:10px;left:6px;margin:-5px 0;position:absolute;right:6px}.nuxt-devtools-resize-handle-vertical{border-radius:5px;bottom:0;cursor:ew-resize;margin:0 -5px;position:absolute;top:6px;width:10px}.nuxt-devtools-resize-handle-corner{border-radius:6px;height:14px;margin:-6px;position:absolute;width:14px}.nuxt-devtools-resize-handle:hover{background:hsla(0,0%,49%,.1)}
167
- </style>
@@ -1,432 +0,0 @@
1
- <script setup lang="ts">
2
- import type { NuxtDevtoolsHostClient } from '@nuxt/devtools/types'
3
- import type { CSSProperties } from 'vue'
4
- import { computed, onMounted, reactive, ref, watchEffect } from 'vue'
5
- import { settings } from '../../settings'
6
- import FrameBox from './FrameBox.vue'
7
- import { state } from './state'
8
- import { millisecondToHumanreadable, useElementBounding, useEventListener, useScreenSafeArea } from './utils'
9
-
10
- const props = defineProps<{
11
- client: NuxtDevtoolsHostClient
12
- }>()
13
-
14
- const panelMargins = reactive({
15
- left: 10,
16
- top: 10,
17
- right: 10,
18
- bottom: 10,
19
- })
20
-
21
- const safeArea = useScreenSafeArea()
22
- const isSafari = navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome')
23
-
24
- watchEffect(() => {
25
- panelMargins.left = safeArea.left.value + 10
26
- panelMargins.top = safeArea.top.value + 10
27
- panelMargins.right = safeArea.right.value + 10
28
- panelMargins.bottom = safeArea.bottom.value + 10
29
- })
30
-
31
- const SNAP_THRESHOLD = 2
32
-
33
- const vars = computed(() => {
34
- const dark = props.client.app.colorMode.value === 'dark'
35
- return {
36
- '--nuxt-devtools-widget-bg': dark ? '#111' : '#ffffff',
37
- '--nuxt-devtools-widget-fg': dark ? '#F5F5F5' : '#111',
38
- '--nuxt-devtools-widget-border': dark ? '#3336' : '#efefef',
39
- '--nuxt-devtools-widget-shadow': dark ? 'rgba(0,0,0,0.3)' : 'rgba(128,128,128,0.1)',
40
- }
41
- })
42
-
43
- const frameBox = ref<HTMLDivElement>()
44
- const panelEl = ref<HTMLDivElement>()
45
- const anchorEl = ref<HTMLDivElement>()
46
-
47
- const windowSize = reactive({ width: 0, height: 0 })
48
- const isDragging = ref(false)
49
- const draggingOffset = reactive({ x: 0, y: 0 })
50
- const mousePosition = reactive({ x: 0, y: 0 })
51
-
52
- function onPointerDown(e: PointerEvent) {
53
- if (!panelEl.value)
54
- return
55
- isDragging.value = true
56
- const { left, top, width, height } = panelEl.value!.getBoundingClientRect()
57
- draggingOffset.x = e.clientX - left - width / 2
58
- draggingOffset.y = e.clientY - top - height / 2
59
- }
60
-
61
- onMounted(() => {
62
- windowSize.width = window.innerWidth
63
- windowSize.height = window.innerHeight
64
-
65
- useEventListener(window, 'resize', () => {
66
- windowSize.width = window.innerWidth
67
- windowSize.height = window.innerHeight
68
- })
69
-
70
- useEventListener(window, 'pointermove', (e: PointerEvent) => {
71
- if (!isDragging.value)
72
- return
73
-
74
- const centerX = windowSize.width / 2
75
- const centerY = windowSize.height / 2
76
-
77
- const x = e.clientX - draggingOffset.x
78
- const y = e.clientY - draggingOffset.y
79
-
80
- mousePosition.x = x
81
- mousePosition.y = y
82
-
83
- // Get position
84
- const deg = Math.atan2(y - centerY, x - centerX)
85
- const HORIZONTAL_MARGIN = 70
86
- const TL = Math.atan2(0 - centerY + HORIZONTAL_MARGIN, 0 - centerX)
87
- const TR = Math.atan2(0 - centerY + HORIZONTAL_MARGIN, windowSize.width - centerX)
88
- const BL = Math.atan2(windowSize.height - HORIZONTAL_MARGIN - centerY, 0 - centerX)
89
- const BR = Math.atan2(windowSize.height - HORIZONTAL_MARGIN - centerY, windowSize.width - centerX)
90
-
91
- state.value.position = deg >= TL && deg <= TR
92
- ? 'top'
93
- : deg >= TR && deg <= BR
94
- ? 'right'
95
- : deg >= BR && deg <= BL
96
- ? 'bottom'
97
- : 'left'
98
-
99
- state.value.left = snapToPoints(x / windowSize.width * 100)
100
- state.value.top = snapToPoints(y / windowSize.height * 100)
101
- })
102
- useEventListener(window, 'pointerup', () => {
103
- isDragging.value = false
104
- })
105
- useEventListener(window, 'pointerleave', () => {
106
- isDragging.value = false
107
- })
108
- })
109
-
110
- function snapToPoints(value: number) {
111
- if (value < 5)
112
- return 0
113
- if (value > 95)
114
- return 100
115
- if (Math.abs(value - 50) < SNAP_THRESHOLD)
116
- return 50
117
- return value
118
- }
119
-
120
- function clamp(value: number, min: number, max: number) {
121
- return Math.min(Math.max(value, min), max)
122
- }
123
-
124
- const isHovering = ref(false)
125
- const isVertical = computed(() => state.value.position === 'left' || state.value.position === 'right')
126
-
127
- const anchorPos = computed(() => {
128
- const halfWidth = (panelEl.value?.clientWidth || 0) / 2
129
- const halfHeight = (panelEl.value?.clientHeight || 0) / 2
130
-
131
- const left = state.value.left * windowSize.width / 100
132
- const top = state.value.top * windowSize.height / 100
133
-
134
- switch (state.value.position) {
135
- case 'top':
136
- return {
137
- left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
138
- top: panelMargins.top + halfHeight,
139
- }
140
- case 'right':
141
- return {
142
- left: windowSize.width - panelMargins.right - halfHeight,
143
- top: clamp(top, halfWidth + panelMargins.top, windowSize.height - halfWidth - panelMargins.bottom),
144
- }
145
- case 'left':
146
- return {
147
- left: panelMargins.left + halfHeight,
148
- top: clamp(top, halfWidth + panelMargins.top, windowSize.height - halfWidth - panelMargins.bottom),
149
- }
150
- case 'bottom':
151
- default:
152
- return {
153
- left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
154
- top: windowSize.height - panelMargins.bottom - halfHeight,
155
- }
156
- }
157
- })
158
-
159
- let _timer: ReturnType<typeof setTimeout> | null = null
160
- function bringUp() {
161
- isHovering.value = true
162
- if (state.value.minimizePanelInactive < 0)
163
- return
164
- if (_timer)
165
- clearTimeout(_timer)
166
- _timer = setTimeout(() => {
167
- isHovering.value = false
168
- }, +state.value.minimizePanelInactive || 0)
169
- }
170
-
171
- const isHidden = computed(() => {
172
- if (state.value.open)
173
- return false
174
- if (settings.ui.showPanel === true)
175
- return false
176
- if (settings.ui.showPanel === false)
177
- return true
178
- // If not explicitly set, show the panel
179
- return false
180
- })
181
-
182
- const isMinimized = computed(() => {
183
- if (state.value.minimizePanelInactive < 0)
184
- return false
185
- if (state.value.minimizePanelInactive === 0)
186
- return true
187
- // @ts-expect-error compatibility
188
- const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0
189
- return !isDragging.value
190
- && !state.value.open
191
- && !isHovering.value
192
- && !isTouchDevice
193
- && state.value.minimizePanelInactive
194
- })
195
-
196
- const anchorStyle = computed(() => {
197
- return {
198
- left: `${anchorPos.value.left}px`,
199
- top: `${anchorPos.value.top}px`,
200
- pointerEvents: isHidden.value ? 'none' : 'auto',
201
- } as const
202
- })
203
-
204
- const panelStyle = computed(() => {
205
- const style: any = {
206
- transform: isVertical.value
207
- ? `translate(${isMinimized.value ? `calc(-50% ${state.value.position === 'right' ? '+' : '-'} 15px)` : '-50%'}, -50%) rotate(90deg)`
208
- : `translate(-50%, ${isMinimized.value ? `calc(-50% ${state.value.position === 'top' ? '-' : '+'} 15px)` : '-50%'})`,
209
- }
210
- if (isHidden.value) {
211
- style.opacity = 0
212
- style.pointerEvents = 'none'
213
- }
214
- if (isMinimized.value) {
215
- switch (state.value.position) {
216
- case 'top':
217
- case 'right':
218
- style.borderTopLeftRadius = '0'
219
- style.borderTopRightRadius = '0'
220
- break
221
- case 'bottom':
222
- case 'left':
223
- style.borderBottomLeftRadius = '0'
224
- style.borderBottomRightRadius = '0'
225
- break
226
- }
227
- }
228
- if (isDragging.value)
229
- style.transition = 'none !important'
230
- return style
231
- })
232
-
233
- const { width: frameWidth, height: frameHeight } = useElementBounding(frameBox)
234
-
235
- const iframeStyle = computed(() => {
236
- // eslint-disable-next-line no-sequences, ts/no-unused-expressions
237
- mousePosition.x, mousePosition.y
238
-
239
- const halfHeight = (panelEl.value?.clientHeight || 0) / 2
240
-
241
- const frameMargin = {
242
- left: panelMargins.left + halfHeight,
243
- top: panelMargins.top + halfHeight,
244
- right: panelMargins.right + halfHeight,
245
- bottom: panelMargins.bottom + halfHeight,
246
- }
247
-
248
- const marginHorizontal = frameMargin.left + frameMargin.right
249
- const marginVertical = frameMargin.top + frameMargin.bottom
250
-
251
- const maxWidth = windowSize.width - marginHorizontal
252
- const maxHeight = windowSize.height - marginVertical
253
-
254
- const style: CSSProperties = {
255
- position: 'fixed',
256
- zIndex: -1,
257
- pointerEvents: (isDragging.value || !state.value.open || props.client.inspector?.isEnabled.value) ? 'none' : 'auto',
258
- width: `min(${state.value.width}vw, calc(100vw - ${marginHorizontal}px))`,
259
- height: `min(${state.value.height}vh, calc(100vh - ${marginVertical}px))`,
260
- }
261
-
262
- const anchor = anchorPos.value
263
- const width = Math.min(maxWidth, state.value.width * windowSize.width / 100)
264
- const height = Math.min(maxHeight, state.value.height * windowSize.height / 100)
265
-
266
- const anchorX = anchor?.left || 0
267
- const anchorY = anchor?.top || 0
268
-
269
- switch (state.value.position) {
270
- case 'top':
271
- case 'bottom':
272
- style.left = `${-frameWidth.value / 2}px`
273
- style.transform = 'translate(0, 0)'
274
- if ((anchorX - frameMargin.left) < width / 2)
275
- style.left = `${width / 2 - anchorX + frameMargin.left - frameWidth.value / 2}px`
276
- else if ((windowSize.width - anchorX - frameMargin.right) < width / 2)
277
- style.left = `${windowSize.width - anchorX - width / 2 - frameMargin.right - frameWidth.value / 2}px`
278
- break
279
- case 'right':
280
- case 'left':
281
- style.top = `${-frameHeight.value / 2}px`
282
- style.transform = 'translate(0, 0)'
283
- if ((anchorY - frameMargin.top) < height / 2)
284
- style.top = `${height / 2 - anchorY + frameMargin.top - frameHeight.value / 2}px`
285
- else if ((windowSize.height - anchorY - frameMargin.bottom) < height / 2)
286
- style.top = `${windowSize.height - anchorY - height / 2 - frameMargin.bottom - frameHeight.value / 2}px`
287
- break
288
- }
289
-
290
- switch (state.value.position) {
291
- case 'top':
292
- style.top = 0
293
- break
294
- case 'right':
295
- style.right = 0
296
- break
297
- case 'left':
298
- style.left = 0
299
- break
300
- case 'bottom':
301
- default:
302
- style.bottom = 0
303
- break
304
- }
305
-
306
- if (props.client.inspector?.isEnabled.value) {
307
- style.opacity = 0
308
- }
309
-
310
- return style
311
- })
312
-
313
- const time = computed(() => {
314
- let type = ''
315
- const metric = props.client.metrics.loading()
316
- let time = -1
317
- if (metric.pageEnd && metric.pageStart) {
318
- time = metric.pageEnd - metric.pageStart
319
- type = 'Page'
320
- }
321
- else if (metric.appLoad && metric.appInit) {
322
- time = metric.appLoad - metric.appInit
323
- type = 'App'
324
- }
325
- bringUp()
326
- if (time < 0)
327
- return [type, '', '-']
328
- return [type, ...millisecondToHumanreadable(time)]
329
- })
330
-
331
- function toggleInspector() {
332
- const isDevToolsOpen = state.value.open
333
- if (!isDevToolsOpen)
334
- props.client.devtools.open()
335
-
336
- props.client.inspector?.enable()
337
-
338
- if (!isDevToolsOpen) {
339
- setTimeout(() => {
340
- props.client.devtools.close()
341
- }, 500)
342
- }
343
- }
344
-
345
- onMounted(() => {
346
- bringUp()
347
- })
348
- </script>
349
-
350
- <template>
351
- <div
352
- id="nuxt-devtools-anchor"
353
- ref="anchorEl"
354
- :style="[anchorStyle, vars]"
355
- :class="{
356
- 'nuxt-devtools-vertical': isVertical,
357
- 'nuxt-devtools-hide': isMinimized,
358
- }"
359
- @mousemove="bringUp"
360
- >
361
- <div
362
- v-if="!isSafari"
363
- class="nuxt-devtools-glowing"
364
- :style="isDragging ? 'opacity: 0.6 !important' : ''"
365
- />
366
- <div
367
- ref="panelEl"
368
- class="nuxt-devtools-panel"
369
- :style="panelStyle"
370
- @pointerdown="onPointerDown"
371
- >
372
- <button
373
- class="nuxt-devtools-icon-button nuxt-devtools-nuxt-button"
374
- title="Toggle Nuxt DevTools"
375
- :style="state.open ? '' : 'filter:saturate(0)'"
376
- @click="client.devtools.toggle()"
377
- >
378
- <svg
379
- viewBox="0 0 324 324" fill="none" xmlns="http://www.w3.org/2000/svg"
380
- style="margin-top:-1px; height: 1.2em; width: 1.2em;"
381
- >
382
- <path d="M181.767 270H302.211C306.037 270 309.795 269.003 313.108 267.107C316.421 265.211 319.172 262.484 321.084 259.2C322.996 255.915 324.002 252.19 324 248.399C323.998 244.607 322.989 240.883 321.074 237.601L240.187 98.7439C238.275 95.4607 235.525 92.7342 232.213 90.8385C228.901 88.9429 225.143 87.9449 221.318 87.9449C217.494 87.9449 213.736 88.9429 210.424 90.8385C207.112 92.7342 204.361 95.4607 202.449 98.7439L181.767 134.272L141.329 64.7975C139.416 61.5145 136.664 58.7884 133.351 56.8931C130.038 54.9978 126.28 54 122.454 54C118.629 54 114.871 54.9978 111.558 56.8931C108.245 58.7884 105.493 61.5145 103.58 64.7975L2.92554 237.601C1.01067 240.883 0.00166657 244.607 2.06272e-06 248.399C-0.00166244 252.19 1.00407 255.915 2.91605 259.2C4.82803 262.484 7.57884 265.211 10.8918 267.107C14.2047 269.003 17.963 270 21.7886 270H97.3936C127.349 270 149.44 256.959 164.641 231.517L201.546 168.172L221.313 134.272L280.637 236.1H201.546L181.767 270ZM96.1611 236.065L43.3984 236.054L122.49 100.291L161.953 168.172L135.531 213.543C125.436 230.051 113.968 236.065 96.1611 236.065Z" fill="#00DC82" />
383
- </svg>
384
- </button>
385
- <div
386
- style="border-left: 1px solid #8883;width:1px;height:10px;"
387
- class="nuxt-devtools-panel-content"
388
- />
389
- <div
390
- class="nuxt-devtools-panel-content nuxt-devtools-label"
391
- :title="`${time[0]} load time`"
392
- >
393
- <div class="nuxt-devtools-label-main">
394
- {{ time[1] }}
395
- </div>
396
- <span class="nuxt-devtools-label-secondary">
397
- {{ time[2] }}
398
- </span>
399
- </div>
400
- <template v-if="client.inspector?.isAvailable">
401
- <div
402
- style="border-left: 1px solid #8883;width:1px;height:10px;"
403
- class="nuxt-devtools-panel-content"
404
- />
405
- <button class="nuxt-devtools-icon-button nuxt-devtools-panel-content" title="Toggle Component Inspector" @click.prevent.stop="toggleInspector">
406
- <svg
407
- xmlns="http://www.w3.org/2000/svg"
408
- style="height: 1.2em; width: 1.2em; opacity:0.5;"
409
- :style="client.inspector.isEnabled.value ? 'opacity:1;color:#00dc82' : ''"
410
- viewBox="0 0 24 24"
411
- >
412
- <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r=".5" fill="currentColor" /><path d="M5 12a7 7 0 1 0 14 0a7 7 0 1 0-14 0m7-9v2m-9 7h2m7 7v2m7-9h2" /></g>
413
- </svg>
414
- </button>
415
- </template>
416
- </div>
417
-
418
- <div
419
- ref="frameBox"
420
- :style="iframeStyle"
421
- >
422
- <FrameBox
423
- :client="client"
424
- :is-dragging="isDragging"
425
- />
426
- </div>
427
- </div>
428
- </template>
429
-
430
- <style scoped>
431
- #nuxt-devtools-anchor{box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;font-size:15px!important;position:fixed;transform:translate(-50%,-50%) rotate(0);transform-origin:center center;width:0;z-index:2147483645}#nuxt-devtools-anchor *{box-sizing:border-box}#nuxt-devtools-anchor button{background:none;border:none;color:inherit;cursor:pointer;margin:0;outline:none;padding:0}#nuxt-devtools-anchor .nuxt-devtools-label{align-items:center;display:flex;font-size:.8em;gap:3px;justify-items:center;line-height:1em;padding:0 7px 0 8px}#nuxt-devtools-anchor .nuxt-devtools-label .nuxt-devtools-label-main{opacity:.8}#nuxt-devtools-anchor .nuxt-devtools-label .nuxt-devtools-label-secondary{font-size:.8em;line-height:.6em;opacity:.5}#nuxt-devtools-anchor .nuxt-devtools-nuxt-button{flex:none}#nuxt-devtools-anchor.nuxt-devtools-vertical .nuxt-devtools-nuxt-button{transform:rotate(-90deg)}#nuxt-devtools-anchor.nuxt-devtools-vertical .nuxt-devtools-label{flex-direction:column;gap:2px;padding:0 10px;transform:rotate(-90deg)}#nuxt-devtools-anchor .nuxt-devtools-panel{align-items:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:var(--nuxt-devtools-widget-bg);border:1px solid var(--nuxt-devtools-widget-border);border-radius:100px;box-shadow:2px 2px 8px var(--nuxt-devtools-widget-shadow);color:var(--nuxt-devtools-widget-fg);display:flex;gap:2px;height:30px;justify-content:flex-start;left:0;max-width:150px;overflow:hidden;padding:2px 2px 2px 2.5px;position:absolute;top:0;touch-action:none;transform:translate(-50%,-50%);transition:all .6s ease,max-width .6s ease,padding .5s ease,transform .4s ease,opacity .2s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}#nuxt-devtools-anchor.nuxt-devtools-hide .nuxt-devtools-panel{max-width:32px;padding:2px 0}#nuxt-devtools-anchor.nuxt-devtools-vertical .nuxt-devtools-panel{box-shadow:2px -2px 8px var(--nuxt-devtools-widget-shadow);transform:translate(-50%,-50%) rotate(90deg)}#nuxt-devtools-anchor .nuxt-devtools-panel-content{transition:opacity .4s ease}#nuxt-devtools-anchor.nuxt-devtools-hide .nuxt-devtools-panel-content{opacity:0}#nuxt-devtools-anchor .nuxt-devtools-icon-button{align-items:center;border-radius:100%;border-width:0;display:flex;height:30px;justify-content:center;opacity:.8;transition:opacity .2s ease-in-out;width:30px}#nuxt-devtools-anchor .nuxt-devtools-icon-button:hover{opacity:1}#nuxt-devtools-anchor:hover .nuxt-devtools-glowing{opacity:.6}#nuxt-devtools-anchor .nuxt-devtools-glowing{background-image:linear-gradient(45deg,#00dc82,#00dc82,#00dc82);border-radius:9999px;filter:blur(60px);height:160px;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transform:translate(-50%,-50%);transition:all 1s ease;width:160px;z-index:-1}@media print{#nuxt-devtools-anchor{display:none}}
432
- </style>
@@ -1,57 +0,0 @@
1
- import { NuxtDevtoolsIframeClient, NuxtDevtoolsHostClient, NuxtDevtoolsGlobal, PluginMetric, TimelineMetrics, LoadingTimeMetric } from '@nuxt/devtools-kit/types';
2
-
3
- declare global {
4
- interface Window {
5
- /**
6
- * API for module integration
7
- */
8
- __NUXT_DEVTOOLS__?: NuxtDevtoolsIframeClient;
9
- /**
10
- * Nuxt DevTools client for host app
11
- */
12
- __NUXT_DEVTOOLS_HOST__?: NuxtDevtoolsHostClient;
13
- /**
14
- * Nuxt DevTools for receiving host client
15
- *
16
- * @internal
17
- */
18
- __NUXT_DEVTOOLS_VIEW__?: NuxtDevtoolsGlobal;
19
- /**
20
- * Metrics for plugin loading time
21
- *
22
- * @internal
23
- */
24
- __NUXT_DEVTOOLS_PLUGINS_METRIC__?: PluginMetric[];
25
- /**
26
- * Metrics for function calls
27
- *
28
- * @internal
29
- */
30
- __NUXT_DEVTOOLS_TIMELINE_METRICS__?: TimelineMetrics;
31
- /**
32
- * Metrics for page / route loading time
33
- *
34
- * @internal
35
- */
36
- __NUXT_DEVTOOLS_TIME_METRIC__?: LoadingTimeMetric;
37
- /**
38
- * Manually disable Nuxt DevTools embedding.
39
- * Used for popup mode.
40
- *
41
- * @internal
42
- */
43
- __NUXT_DEVTOOLS_DISABLE__?: boolean;
44
- /**
45
- * Is popup mode
46
- *
47
- * @internal
48
- */
49
- __NUXT_DEVTOOLS_IS_POPUP__?: boolean;
50
- /**
51
- * Experimental API: Picture-in-Picture mode
52
- *
53
- * @see https://developer.chrome.com/docs/web-platform/document-picture-in-picture/
54
- */
55
- documentPictureInPicture?: any;
56
- }
57
- }