@nuxt/devtools-nightly 0.0.0 → 2.0.0-28980754.13f6fd0

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 (146) hide show
  1. package/.discoveryrc.cjs +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +129 -0
  4. package/cli.mjs +2 -0
  5. package/dist/chunks/analyze-build.mjs +58 -0
  6. package/dist/chunks/module-main.mjs +18277 -0
  7. package/dist/chunks/plugin-metrics.mjs +68 -0
  8. package/dist/chunks/timeline.mjs +73 -0
  9. package/dist/chunks/vite-inspect.mjs +61 -0
  10. package/dist/chunks/vscode.mjs +202 -0
  11. package/dist/chunks/vue-devtools.mjs +18 -0
  12. package/dist/chunks/vue-inspector.mjs +15 -0
  13. package/dist/client/200.html +29 -0
  14. package/dist/client/404.html +29 -0
  15. package/dist/client/_nuxt/__blank-lg13rweu.js +1 -0
  16. package/dist/client/_nuxt/analyze-build-iq7xh3z1.js +1 -0
  17. package/dist/client/_nuxt/assets-gh0s06d1.js +16 -0
  18. package/dist/client/_nuxt/assets.css-hmxl533k.css +1 -0
  19. package/dist/client/_nuxt/builds/latest.json +1 -0
  20. package/dist/client/_nuxt/builds/meta/49cca9aa-555f-4765-adf5-305615694a06.json +1 -0
  21. package/dist/client/_nuxt/client-kpmlv67d.js +1 -0
  22. package/dist/client/_nuxt/code-diff.vue-n76oqanv.js +8 -0
  23. package/dist/client/_nuxt/code-snippets.vue-mo56dnf7.js +1 -0
  24. package/dist/client/_nuxt/components-lsb65kqi.js +1 -0
  25. package/dist/client/_nuxt/composable-item.vue-ou7mghhp.js +1 -0
  26. package/dist/client/_nuxt/constants-b32h69zq.js +1 -0
  27. package/dist/client/_nuxt/custom-_name_-jtqok9n0.js +1 -0
  28. package/dist/client/_nuxt/data-schema-button.vue-c1grymka.js +1 -0
  29. package/dist/client/_nuxt/data-schema-drawer-d4rpskxd.js +2 -0
  30. package/dist/client/_nuxt/default-g4qh1jek.js +1 -0
  31. package/dist/client/_nuxt/duration-display.vue-dzttyi5n.js +1 -0
  32. package/dist/client/_nuxt/e6dj4v2s.js +17 -0
  33. package/dist/client/_nuxt/entry.css-mj1nvcy6.css +1 -0
  34. package/dist/client/_nuxt/error-404-kkixf30c.js +1 -0
  35. package/dist/client/_nuxt/error-404.css-fwe7gpvk.css +1 -0
  36. package/dist/client/_nuxt/error-500-m1ccut5u.js +1 -0
  37. package/dist/client/_nuxt/error-500.css-djemplc9.css +1 -0
  38. package/dist/client/_nuxt/error-ow5xdwzf.js +9 -0
  39. package/dist/client/_nuxt/filepath-item.vue-emq61mdv.js +1 -0
  40. package/dist/client/_nuxt/full-nu44fgoz.js +1 -0
  41. package/dist/client/_nuxt/help-fab.css-ms50khsu.css +1 -0
  42. package/dist/client/_nuxt/help-fab.vue-pnejmv3y.js +1 -0
  43. package/dist/client/_nuxt/hooks-mgy9fbq4.js +1 -0
  44. package/dist/client/_nuxt/imports-hjuvh4if.js +1 -0
  45. package/dist/client/_nuxt/index-g2a9x4et.js +1 -0
  46. package/dist/client/_nuxt/index-ioxrnncp.js +2 -0
  47. package/dist/client/_nuxt/index-obsucz0g.js +1 -0
  48. package/dist/client/_nuxt/launch-page.vue-kdqfy3so.js +1 -0
  49. package/dist/client/_nuxt/modules-k3t829jl.js +1 -0
  50. package/dist/client/_nuxt/nbadge-drglxech.js +1 -0
  51. package/dist/client/_nuxt/ncheckbox.vue-n4yvgmy3.js +1 -0
  52. package/dist/client/_nuxt/ncode-block.css-lvdc77tw.css +1 -0
  53. package/dist/client/_nuxt/ncode-block.vue-dt6krs6h.js +2 -0
  54. package/dist/client/_nuxt/ndrawer.vue-dekxbytt.js +1 -0
  55. package/dist/client/_nuxt/ndropdown.vue-ftpt7kxg.js +1 -0
  56. package/dist/client/_nuxt/nicon-title.vue-hzhi6u0u.js +1 -0
  57. package/dist/client/_nuxt/nlink.vue-mgfv3kxu.js +1 -0
  58. package/dist/client/_nuxt/nmarkdown.vue-jpbjhala.js +1 -0
  59. package/dist/client/_nuxt/nnavbar.vue-ifbz2rxx.js +1 -0
  60. package/dist/client/_nuxt/none-vukmnfqm.js +1 -0
  61. package/dist/client/_nuxt/nsection-block-c3li7360.js +1 -0
  62. package/dist/client/_nuxt/nsection-block.css-e7kbjm7k.css +1 -0
  63. package/dist/client/_nuxt/nselect-tabs.vue-7ode1s40.js +1 -0
  64. package/dist/client/_nuxt/nselect.vue-g1dfz7uv.js +1 -0
  65. package/dist/client/_nuxt/nswitch.vue-iu20lc9i.js +1 -0
  66. package/dist/client/_nuxt/open-graph-fqsf6nxz.js +3 -0
  67. package/dist/client/_nuxt/open-graph.css-e21qzmvj.css +1 -0
  68. package/dist/client/_nuxt/overview-fu25jfez.js +1 -0
  69. package/dist/client/_nuxt/pages-krmwwon2.js +1 -0
  70. package/dist/client/_nuxt/payload-brwibidn.js +1 -0
  71. package/dist/client/_nuxt/pinia-jwh05bbu.js +1 -0
  72. package/dist/client/_nuxt/plugins-ct1odttb.js +1 -0
  73. package/dist/client/_nuxt/render-tree-btmc22jz.js +1 -0
  74. package/dist/client/_nuxt/runtime-configs-n2sp6jan.js +1 -0
  75. package/dist/client/_nuxt/server-discovery-jimy0pfh.js +1 -0
  76. package/dist/client/_nuxt/server-route-inputs.vue-ldyagniy.js +1 -0
  77. package/dist/client/_nuxt/server-routes-hly5t016.js +9 -0
  78. package/dist/client/_nuxt/server-tasks-morkovw5.js +1 -0
  79. package/dist/client/_nuxt/settings-ic9nbnp8.js +1 -0
  80. package/dist/client/_nuxt/stacktrace-list.vue-nqi994si.js +1 -0
  81. package/dist/client/_nuxt/state-components-ka9yswzm.js +1 -0
  82. package/dist/client/_nuxt/state-editor.vue-nbrmuzl0.js +1 -0
  83. package/dist/client/_nuxt/state-modules-fi6koj0q.js +1 -0
  84. package/dist/client/_nuxt/storage-kce0wh6l.js +1 -0
  85. package/dist/client/_nuxt/terminals-bz0knva4.js +1 -0
  86. package/dist/client/_nuxt/terminals.css-mejv43xm.css +1 -0
  87. package/dist/client/_nuxt/timeline-eie3snk2.js +31 -0
  88. package/dist/client/_nuxt/timeline.css-lhkpu01p.css +1 -0
  89. package/dist/client/_nuxt/unocss-runtime-cb61k1ql.js +1 -0
  90. package/dist/client/_nuxt/vendor/json-editor-vue-kcahofzr.js +3818 -0
  91. package/dist/client/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css +1 -0
  92. package/dist/client/_nuxt/vendor/markdown-it-fvu08dbs.js +16 -0
  93. package/dist/client/_nuxt/vendor/quicktype-core-lnbp3n5r.js +1006 -0
  94. package/dist/client/_nuxt/vendor/shiki-bpva4tco.js +282 -0
  95. package/dist/client/_nuxt/vendor/unocss-mstcul8h.js +2 -0
  96. package/dist/client/_nuxt/vendor/unocss.css-mhvipxpl.css +1 -0
  97. package/dist/client/_nuxt/vendor/vis-fzckz0r6.js +98 -0
  98. package/dist/client/_nuxt/vendor/xterm-b1jefe3j.js +9 -0
  99. package/dist/client/_nuxt/vendor/xterm.css-egmhki83.css +32 -0
  100. package/dist/client/_nuxt/virtual-files-ffma32j9.js +1 -0
  101. package/dist/client/_nuxt/virtual-files.css-gqpg2wnb.css +1 -0
  102. package/dist/client/_nuxt/vue-virtual-scroller.esm-ryb7s73q.js +2 -0
  103. package/dist/client/discovery/index.html +611 -0
  104. package/dist/client/index.html +29 -0
  105. package/dist/client/nuxt.svg +3 -0
  106. package/dist/dirs.d.mts +7 -0
  107. package/dist/dirs.d.ts +7 -0
  108. package/dist/dirs.mjs +28 -0
  109. package/dist/module.cjs +5 -0
  110. package/dist/module.d.mts +9 -0
  111. package/dist/module.d.ts +9 -0
  112. package/dist/module.json +9 -0
  113. package/dist/module.mjs +6 -0
  114. package/dist/runtime/auth/index.html +76 -0
  115. package/dist/runtime/function-metrics-helpers.d.ts +3 -0
  116. package/dist/runtime/function-metrics-helpers.js +69 -0
  117. package/dist/runtime/nitro/inline.d.ts +3 -0
  118. package/dist/runtime/nitro/inline.js +6 -0
  119. package/dist/runtime/plugins/devtools.client.d.ts +2 -0
  120. package/dist/runtime/plugins/devtools.client.js +56 -0
  121. package/dist/runtime/plugins/devtools.server.d.ts +2 -0
  122. package/dist/runtime/plugins/devtools.server.js +7 -0
  123. package/dist/runtime/plugins/view/FrameBox.vue +167 -0
  124. package/dist/runtime/plugins/view/Main.vue +415 -0
  125. package/dist/runtime/plugins/view/client.d.ts +12 -0
  126. package/dist/runtime/plugins/view/client.js +332 -0
  127. package/dist/runtime/plugins/view/state.d.ts +5 -0
  128. package/dist/runtime/plugins/view/state.js +17 -0
  129. package/dist/runtime/plugins/view/utils.d.ts +31 -0
  130. package/dist/runtime/plugins/view/utils.js +156 -0
  131. package/dist/runtime/settings.d.ts +4 -0
  132. package/dist/runtime/settings.js +2 -0
  133. package/dist/runtime/shared/hooks.d.ts +2 -0
  134. package/dist/runtime/shared/hooks.js +33 -0
  135. package/dist/runtime/use-nuxt-devtools.d.ts +8 -0
  136. package/dist/runtime/use-nuxt-devtools.js +23 -0
  137. package/dist/runtime/vue-devtools-client.d.ts +2 -0
  138. package/dist/runtime/vue-devtools-client.js +8 -0
  139. package/dist/shared/devtools-nightly.2a48a9e5.d.mts +62 -0
  140. package/dist/shared/devtools-nightly.2a48a9e5.d.ts +62 -0
  141. package/dist/shared/devtools-nightly.60b2ba4d.mjs +122 -0
  142. package/dist/types.d.mts +42 -0
  143. package/dist/types.d.ts +42 -0
  144. package/dist/types.mjs +1 -0
  145. package/package.json +128 -2
  146. package/types.d.ts +1 -0
@@ -0,0 +1,415 @@
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 ? '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
+ return style
307
+ })
308
+
309
+ const time = computed(() => {
310
+ let type = ''
311
+ const metric = props.client.metrics.loading()
312
+ let time = -1
313
+ if (metric.pageEnd && metric.pageStart) {
314
+ time = metric.pageEnd - metric.pageStart
315
+ type = 'Page'
316
+ }
317
+ else if (metric.appLoad && metric.appInit) {
318
+ time = metric.appLoad - metric.appInit
319
+ type = 'App'
320
+ }
321
+ bringUp()
322
+ if (time < 0)
323
+ return [type, '', '-']
324
+ return [type, ...millisecondToHumanreadable(time)]
325
+ })
326
+
327
+ onMounted(() => {
328
+ bringUp()
329
+ })
330
+ </script>
331
+
332
+ <template>
333
+ <div
334
+ id="nuxt-devtools-anchor"
335
+ ref="anchorEl"
336
+ :style="[anchorStyle, vars]"
337
+ :class="{
338
+ 'nuxt-devtools-vertical': isVertical,
339
+ 'nuxt-devtools-hide': isMinimized,
340
+ }"
341
+ @mousemove="bringUp"
342
+ >
343
+ <div
344
+ v-if="!isSafari"
345
+ class="nuxt-devtools-glowing"
346
+ :style="isDragging ? 'opacity: 0.6 !important' : ''"
347
+ />
348
+ <div
349
+ ref="panelEl"
350
+ class="nuxt-devtools-panel"
351
+ :style="panelStyle"
352
+ @pointerdown="onPointerDown"
353
+ >
354
+ <button
355
+ class="nuxt-devtools-icon-button nuxt-devtools-nuxt-button"
356
+ title="Toggle Nuxt DevTools"
357
+ :style="state.open ? '' : 'filter:saturate(0)'"
358
+ @click="client.devtools.toggle()"
359
+ >
360
+ <svg
361
+ viewBox="0 0 324 324" fill="none" xmlns="http://www.w3.org/2000/svg"
362
+ style="margin-top:-1px; height: 1.2em; width: 1.2em;"
363
+ >
364
+ <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" />
365
+ </svg>
366
+ </button>
367
+ <div
368
+ style="border-left: 1px solid #8883;width:1px;height:10px;"
369
+ class="nuxt-devtools-panel-content"
370
+ />
371
+ <div
372
+ class="nuxt-devtools-panel-content nuxt-devtools-label"
373
+ :title="`${time[0]} load time`"
374
+ >
375
+ <div class="nuxt-devtools-label-main">
376
+ {{ time[1] }}
377
+ </div>
378
+ <span class="nuxt-devtools-label-secondary">
379
+ {{ time[2] }}
380
+ </span>
381
+ </div>
382
+ <template v-if="client.inspector">
383
+ <div
384
+ style="border-left: 1px solid #8883;width:1px;height:10px;"
385
+ class="nuxt-devtools-panel-content"
386
+ />
387
+ <button class="nuxt-devtools-icon-button nuxt-devtools-panel-content" title="Toggle Component Inspector" @click="client.inspector.toggle">
388
+ <svg
389
+ xmlns="http://www.w3.org/2000/svg"
390
+ style="height: 1.2em; width: 1.2em; opacity:0.5;"
391
+ :style="client.inspector.isEnabled.value ? 'opacity:1;color:#00dc82' : ''"
392
+ viewBox="0 0 24 24"
393
+ >
394
+ <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>
395
+ </svg>
396
+ </button>
397
+ </template>
398
+ </div>
399
+
400
+ <div
401
+ v-show="!client.inspector?.isEnabled.value"
402
+ ref="frameBox"
403
+ :style="iframeStyle"
404
+ >
405
+ <FrameBox
406
+ :client="client"
407
+ :is-dragging="isDragging"
408
+ />
409
+ </div>
410
+ </div>
411
+ </template>
412
+
413
+ <style scoped>
414
+ #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}}
415
+ </style>
@@ -0,0 +1,12 @@
1
+ import type { Ref } from 'vue';
2
+ import type { Router } from 'vue-router';
3
+ declare const clientRef: import("vue").ShallowRef<any, any>;
4
+ export { clientRef as client };
5
+ export type ColorScheme = 'dark' | 'light';
6
+ export declare function setupDevToolsClient({ nuxt, clientHooks, timeMetric, router, }: {
7
+ nuxt: any;
8
+ clientHooks: any;
9
+ timeMetric: any;
10
+ router: Router;
11
+ }): Promise<void>;
12
+ export declare function useClientColorMode(): Ref<ColorScheme>;