@nuxt/devtools 0.6.2 → 0.6.4

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 (143) hide show
  1. package/README.md +2 -4
  2. package/dist/chunks/module-main.mjs +32 -137
  3. package/dist/client/200.html +2 -2
  4. package/dist/client/404.html +2 -2
  5. package/dist/client/__blank/index.html +2 -2
  6. package/dist/client/_nuxt/AuthRequiredPanel.vue.fa96c108.js +1 -0
  7. package/dist/client/_nuxt/Badge.6957c09f.js +1 -0
  8. package/dist/client/_nuxt/CodeSnippets.vue.c709c5db.js +1 -0
  9. package/dist/client/_nuxt/DrawerRight.vue.1af2d3b5.js +1 -0
  10. package/dist/client/_nuxt/DurationDisplay.vue.5ef8c229.js +1 -0
  11. package/dist/client/_nuxt/FilepathItem.vue.b9c2f241.js +1 -0
  12. package/dist/client/_nuxt/HelpFab.vue.517eb06f.js +1 -0
  13. package/dist/client/_nuxt/{LaunchPage.vue.b85270dd.js → LaunchPage.vue.f67f57a2.js} +1 -1
  14. package/dist/client/_nuxt/NCheckbox.vue.1647e69d.js +1 -0
  15. package/dist/client/_nuxt/{NCodeBlock.vue.de2cd5a6.js → NCodeBlock.vue.09bc830f.js} +1 -1
  16. package/dist/client/_nuxt/NIconButton.vue.ac0edffe.js +1 -0
  17. package/dist/client/_nuxt/NIconTitle.vue.c43a6ad4.js +1 -0
  18. package/dist/client/_nuxt/NLink.vue.cd078056.js +1 -0
  19. package/dist/client/_nuxt/NMarkdown.vue.7e390ca1.js +1 -0
  20. package/dist/client/_nuxt/{NPanelGrids.fc7166ff.js → NPanelGrids.017932a3.js} +1 -1
  21. package/dist/client/_nuxt/NSectionBlock.82d7dd64.js +1 -0
  22. package/dist/client/_nuxt/NSelect.vue.bf162e70.js +1 -0
  23. package/dist/client/_nuxt/NSwitch.vue.27d90ab4.js +1 -0
  24. package/dist/client/_nuxt/NTip.vue.b3e13fa6.js +1 -0
  25. package/dist/client/_nuxt/Navbar.vue.73274a4d.js +1 -0
  26. package/dist/client/_nuxt/PanelLeftRight.vue.747d389a.js +1 -0
  27. package/dist/client/_nuxt/StateEditor.vue.e676b88f.js +1 -0
  28. package/dist/client/_nuxt/__blank.a90b7fd4.js +1 -0
  29. package/dist/client/_nuxt/analyze-build.3e750a33.js +1 -0
  30. package/dist/client/_nuxt/{assets.cea82447.js → assets.a88c9236.js} +3 -3
  31. package/dist/client/_nuxt/{client.aa60153e.js → client.0c1ac957.js} +1 -1
  32. package/dist/client/_nuxt/{components.67be79c1.js → components.55400a43.js} +27 -27
  33. package/dist/client/_nuxt/custom-_name_.00651de5.js +1 -0
  34. package/dist/client/_nuxt/default.c2fcd4ff.js +1 -0
  35. package/dist/client/_nuxt/entry.51f9b393.js +21 -0
  36. package/dist/client/_nuxt/entry.eeaf510e.css +1 -0
  37. package/dist/client/_nuxt/error-404.1de0812a.js +1 -0
  38. package/dist/client/_nuxt/error-404.91003ceb.css +1 -0
  39. package/dist/client/_nuxt/error-500.33274ff0.js +1 -0
  40. package/dist/client/_nuxt/error-500.7e02f53c.css +1 -0
  41. package/dist/client/_nuxt/full.cc6d1947.js +1 -0
  42. package/dist/client/_nuxt/hooks.2e0543da.js +1 -0
  43. package/dist/client/_nuxt/imports.93e9a9ad.js +1 -0
  44. package/dist/client/_nuxt/index.7921977f.js +1 -0
  45. package/dist/client/_nuxt/{index.31423b81.js → index.e3bac72d.js} +1 -1
  46. package/dist/client/_nuxt/{json-editor-vue.0e484aeb.js → json-editor-vue.63210eab.js} +1 -1
  47. package/dist/client/_nuxt/middleware.22e645cd.js +1 -0
  48. package/dist/client/_nuxt/{modules.b435656d.js → modules.0d588e7f.js} +3 -3
  49. package/dist/client/_nuxt/{none.548277ee.js → none.d965e114.js} +1 -1
  50. package/dist/client/_nuxt/open-graph.015a8911.js +3 -0
  51. package/dist/client/_nuxt/overview.87a2d84e.js +1 -0
  52. package/dist/client/_nuxt/pages.22e71687.js +1 -0
  53. package/dist/client/_nuxt/payload.e7e17f38.js +1 -0
  54. package/dist/client/_nuxt/plugins.c012cd51.js +1 -0
  55. package/dist/client/_nuxt/{runtime-configs.c19cf62e.js → runtime-configs.dcd39c80.js} +1 -1
  56. package/dist/client/_nuxt/server-routes.b7bff39c.js +9 -0
  57. package/dist/client/_nuxt/{settings.223347c0.js → settings.8cd632fb.js} +1 -1
  58. package/dist/client/_nuxt/{state-components.7a725a3e.js → state-components.2e9cbedc.js} +1 -1
  59. package/dist/client/_nuxt/state-modules.c1d4a518.js +1 -0
  60. package/dist/client/_nuxt/storage.2e3e1567.js +1 -0
  61. package/dist/client/_nuxt/{terminals.838c617b.js → terminals.5d5e540d.js} +2 -2
  62. package/dist/client/_nuxt/{unocss-runtime.8cb4743c.js → unocss-runtime.9b1d4e8a.js} +1 -1
  63. package/dist/client/_nuxt/virtual-files.e4f10f72.js +1 -0
  64. package/dist/client/index.html +2 -2
  65. package/dist/client/modules/analyze-build/index.html +2 -2
  66. package/dist/client/modules/assets/index.html +2 -2
  67. package/dist/client/modules/components/index.html +2 -2
  68. package/dist/client/modules/hooks/index.html +2 -2
  69. package/dist/client/modules/imports/index.html +2 -2
  70. package/dist/client/modules/middleware/index.html +2 -2
  71. package/dist/client/modules/modules/index.html +2 -2
  72. package/dist/client/modules/open-graph/index.html +2 -2
  73. package/dist/client/modules/overview/index.html +2 -2
  74. package/dist/client/modules/pages/index.html +2 -2
  75. package/dist/client/modules/payload/index.html +2 -2
  76. package/dist/client/modules/plugins/index.html +2 -2
  77. package/dist/client/modules/runtime-configs/index.html +2 -2
  78. package/dist/client/modules/server-routes/index.html +2 -2
  79. package/dist/client/modules/storage/index.html +2 -2
  80. package/dist/client/modules/terminals/index.html +2 -2
  81. package/dist/client/modules/virtual-files/index.html +2 -2
  82. package/dist/client/settings/index.html +2 -2
  83. package/dist/global-20ccb74c.d.ts +52 -0
  84. package/dist/module.d.ts +2 -0
  85. package/dist/module.json +1 -1
  86. package/dist/runtime/plugins/devtools.client.d.ts +0 -8
  87. package/dist/runtime/plugins/devtools.client.mjs +10 -84
  88. package/dist/runtime/plugins/view/FrameBox.vue +80 -48
  89. package/dist/runtime/plugins/view/Main.vue +82 -28
  90. package/dist/runtime/plugins/view/client.d.ts +8 -0
  91. package/dist/runtime/plugins/view/client.mjs +209 -1
  92. package/dist/runtime/plugins/view/state.d.ts +1 -4
  93. package/dist/runtime/plugins/view/state.mjs +2 -20
  94. package/dist/runtime/plugins/view/utils.d.ts +12 -0
  95. package/dist/runtime/plugins/view/utils.mjs +32 -0
  96. package/dist/types.d.ts +2 -0
  97. package/package.json +18 -18
  98. package/dist/client/_nuxt/AuthRequiredPanel.vue.4f66b5dd.js +0 -1
  99. package/dist/client/_nuxt/Badge.2cc4687e.js +0 -1
  100. package/dist/client/_nuxt/CodeSnippets.vue.1e158b8f.js +0 -1
  101. package/dist/client/_nuxt/DrawerRight.vue.d80827fd.js +0 -1
  102. package/dist/client/_nuxt/DurationDisplay.vue.a48b74dd.js +0 -1
  103. package/dist/client/_nuxt/FilepathItem.vue.df9b46ef.js +0 -1
  104. package/dist/client/_nuxt/HelpFab.vue.49173e4b.js +0 -1
  105. package/dist/client/_nuxt/NCheckbox.vue.df53e265.js +0 -1
  106. package/dist/client/_nuxt/NIconButton.vue.e211c1b6.js +0 -1
  107. package/dist/client/_nuxt/NIconTitle.vue.4e3340eb.js +0 -1
  108. package/dist/client/_nuxt/NLink.vue.53529111.js +0 -1
  109. package/dist/client/_nuxt/NMarkdown.vue.26c114a8.js +0 -1
  110. package/dist/client/_nuxt/NSectionBlock.0eaaa956.js +0 -1
  111. package/dist/client/_nuxt/NSelect.vue.94ec8f3c.js +0 -1
  112. package/dist/client/_nuxt/NSwitch.vue.7f4e43b3.js +0 -1
  113. package/dist/client/_nuxt/NTip.vue.c99855ad.js +0 -1
  114. package/dist/client/_nuxt/Navbar.vue.a50c38bf.js +0 -1
  115. package/dist/client/_nuxt/NpmVersionCheck.vue.029b0cde.js +0 -1
  116. package/dist/client/_nuxt/PanelLeftRight.vue.1e85c7f2.js +0 -1
  117. package/dist/client/_nuxt/StateEditor.vue.4e5aa888.js +0 -1
  118. package/dist/client/_nuxt/__blank.8e143dfc.js +0 -1
  119. package/dist/client/_nuxt/analyze-build.d94a4835.js +0 -1
  120. package/dist/client/_nuxt/custom-_name_.ed0df2f5.js +0 -1
  121. package/dist/client/_nuxt/default.29185309.js +0 -1
  122. package/dist/client/_nuxt/editor.24e006dd.js +0 -1
  123. package/dist/client/_nuxt/entry.ea777320.css +0 -1
  124. package/dist/client/_nuxt/entry.f3de3eb8.js +0 -19
  125. package/dist/client/_nuxt/error-404.09e25f4a.js +0 -1
  126. package/dist/client/_nuxt/error-404.2618a69f.css +0 -1
  127. package/dist/client/_nuxt/error-500.0bde1cc6.js +0 -1
  128. package/dist/client/_nuxt/error-500.12a2683b.css +0 -1
  129. package/dist/client/_nuxt/error-component.753dcd89.js +0 -3
  130. package/dist/client/_nuxt/full.e7e50a56.js +0 -1
  131. package/dist/client/_nuxt/hooks.c5f385b4.js +0 -1
  132. package/dist/client/_nuxt/imports.ab8bf33a.js +0 -1
  133. package/dist/client/_nuxt/index.686c37b5.js +0 -1
  134. package/dist/client/_nuxt/middleware.08e999fd.js +0 -1
  135. package/dist/client/_nuxt/open-graph.a806949f.js +0 -3
  136. package/dist/client/_nuxt/overview.08fa2255.js +0 -1
  137. package/dist/client/_nuxt/pages.9797a06b.js +0 -1
  138. package/dist/client/_nuxt/payload.f6049d4c.js +0 -1
  139. package/dist/client/_nuxt/plugins.7ff70558.js +0 -1
  140. package/dist/client/_nuxt/server-routes.34b80486.js +0 -9
  141. package/dist/client/_nuxt/storage.446005cc.js +0 -1
  142. package/dist/client/_nuxt/virtual-files.0f8a6122.js +0 -1
  143. package/dist/runtime/plugins/view/Frame.vue +0 -105
@@ -1,17 +1,33 @@
1
1
  <script setup lang="ts">
2
2
  import type { CSSProperties } from 'vue'
3
- import { computed, onMounted, reactive, ref } from 'vue'
3
+ import { computed, onMounted, reactive, ref, watchEffect } from 'vue'
4
4
  import type { NuxtDevtoolsHostClient } from '../../../types'
5
- import { state, togglePanel } from './state'
6
- import { millisecondToHumanreadable, useEventListener } from './utils'
5
+ import { state } from './state'
6
+ import { millisecondToHumanreadable, useEventListener, useScreenSafeArea } from './utils'
7
7
  import FrameBox from './FrameBox.vue'
8
8
 
9
9
  const props = defineProps<{
10
10
  client: NuxtDevtoolsHostClient
11
11
  }>()
12
12
 
13
- const PANEL_MARGIN = 10
14
- const FRAME_MARGIN = 24
13
+ const panelMargins = reactive({
14
+ left: 10,
15
+ top: 10,
16
+ right: 10,
17
+ bottom: 10,
18
+ })
19
+
20
+ const safeArea = useScreenSafeArea()
21
+
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
+
15
31
  const SNAP_THRESHOLD = 2
16
32
 
17
33
  const vars = computed(() => {
@@ -99,6 +115,10 @@ function snapToPoints(value: number) {
99
115
  return value
100
116
  }
101
117
 
118
+ function clamp(value: number, min: number, max: number) {
119
+ return Math.min(Math.max(value, min), max)
120
+ }
121
+
102
122
  const isVertical = computed(() => state.value.position === 'left' || state.value.position === 'right')
103
123
 
104
124
  const anchorPos = computed(() => {
@@ -111,24 +131,24 @@ const anchorPos = computed(() => {
111
131
  switch (state.value.position) {
112
132
  case 'top':
113
133
  return {
114
- left: Math.min(Math.max(left, halfWidth + PANEL_MARGIN), windowSize.width - halfWidth - PANEL_MARGIN),
115
- top: PANEL_MARGIN + halfHeight,
134
+ left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
135
+ top: panelMargins.top + halfHeight,
116
136
  }
117
137
  case 'right':
118
138
  return {
119
- left: windowSize.width - PANEL_MARGIN - halfHeight,
120
- top,
139
+ left: windowSize.width - panelMargins.right - halfHeight,
140
+ top: clamp(top, halfWidth + panelMargins.top, windowSize.height - halfWidth - panelMargins.bottom),
121
141
  }
122
142
  case 'left':
123
143
  return {
124
- left: PANEL_MARGIN + halfHeight,
125
- top,
144
+ left: panelMargins.left + halfHeight,
145
+ top: clamp(top, halfWidth + panelMargins.top, windowSize.height - halfWidth - panelMargins.bottom),
126
146
  }
127
147
  case 'bottom':
128
148
  default:
129
149
  return {
130
- left: Math.min(Math.max(left, halfWidth + PANEL_MARGIN), windowSize.width - halfWidth - PANEL_MARGIN),
131
- top: windowSize.height - PANEL_MARGIN - halfHeight,
150
+ left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
151
+ top: windowSize.height - panelMargins.bottom - halfHeight,
132
152
  }
133
153
  }
134
154
  })
@@ -139,14 +159,26 @@ const iframeStyle = computed(() => {
139
159
  // eslint-disable-next-line no-unused-expressions, no-sequences
140
160
  mousePosition.x, mousePosition.y
141
161
 
142
- const maxWidth = windowSize.width - FRAME_MARGIN * 2
143
- const maxHeight = windowSize.height - FRAME_MARGIN * 2
162
+ const halfHeight = (panelEl.value?.clientHeight || 0) / 2
163
+
164
+ const frameMargin = {
165
+ left: panelMargins.left + halfHeight,
166
+ top: panelMargins.top + halfHeight,
167
+ right: panelMargins.right + halfHeight,
168
+ bottom: panelMargins.bottom + halfHeight,
169
+ }
170
+
171
+ const marginHorizontal = frameMargin.left + frameMargin.right
172
+ const marginVertical = frameMargin.top + frameMargin.bottom
173
+
174
+ const maxWidth = windowSize.width - marginHorizontal
175
+ const maxHeight = windowSize.height - marginVertical
144
176
 
145
177
  const style: CSSProperties = {
146
178
  zIndex: -1,
147
179
  pointerEvents: isDragging.value ? 'none' : 'auto',
148
- width: `min(${state.value.width}vw, calc(100vw - ${FRAME_MARGIN * 2}px))`,
149
- height: `min(${state.value.height}vh, calc(100vh - ${FRAME_MARGIN * 2}px))`,
180
+ width: `min(${state.value.width}vw, calc(100vw - ${marginHorizontal}px))`,
181
+ height: `min(${state.value.height}vh, calc(100vh - ${marginVertical}px))`,
150
182
  }
151
183
 
152
184
  const anchor = anchorPos.value
@@ -161,19 +193,19 @@ const iframeStyle = computed(() => {
161
193
  case 'bottom':
162
194
  style.left = 0
163
195
  style.transform = 'translate(-50%, 0)'
164
- if ((anchorX - FRAME_MARGIN) < width / 2)
165
- style.left = `${width / 2 - anchorX + FRAME_MARGIN}px`
166
- else if ((windowSize.width - anchorX - FRAME_MARGIN) < width / 2)
167
- style.left = `${windowSize.width - anchorX - width / 2 - FRAME_MARGIN}px`
196
+ if ((anchorX - frameMargin.left) < width / 2)
197
+ style.left = `${width / 2 - anchorX + frameMargin.left}px`
198
+ else if ((windowSize.width - anchorX - frameMargin.right) < width / 2)
199
+ style.left = `${windowSize.width - anchorX - width / 2 - frameMargin.right}px`
168
200
  break
169
201
  case 'right':
170
202
  case 'left':
171
203
  style.top = 0
172
204
  style.transform = 'translate(0, -50%)'
173
- if ((anchorY - FRAME_MARGIN) < height / 2)
174
- style.top = `${height / 2 - anchorY + FRAME_MARGIN}px`
175
- else if ((windowSize.height - anchorY - FRAME_MARGIN) < height / 2)
176
- style.top = `${windowSize.height - anchorY - height / 2 - FRAME_MARGIN}px`
205
+ if ((anchorY - frameMargin.top) < height / 2)
206
+ style.top = `${height / 2 - anchorY + frameMargin.top}px`
207
+ else if ((windowSize.height - anchorY - frameMargin.bottom) < height / 2)
208
+ style.top = `${windowSize.height - anchorY - height / 2 - frameMargin.bottom}px`
177
209
  break
178
210
  }
179
211
 
@@ -221,9 +253,14 @@ const time = computed(() => {
221
253
  :style="[anchorStyle, vars]"
222
254
  :class="{ 'nuxt-devtools-vertical': isVertical }"
223
255
  >
224
- <div class="nuxt-devtools-glowing" :style="isDragging ? 'opacity: 0.6 !important' : ''" />
256
+ <div v-if="!isSafari" class="nuxt-devtools-glowing" :style="isDragging ? 'opacity: 0.6 !important' : ''" />
225
257
  <div ref="panelEl" class="nuxt-devtools-panel" @pointerdown="onPointerDown">
226
- <button class="nuxt-devtools-icon-button nuxt-devtools-nuxt-button" title="Toggle Nuxt DevTools" @click="togglePanel">
258
+ <button
259
+ class="nuxt-devtools-icon-button nuxt-devtools-nuxt-button"
260
+ title="Toggle Nuxt DevTools"
261
+ :style="state.open ? '' : 'filter:saturate(0)'"
262
+ @click="client.toggle()"
263
+ >
227
264
  <svg
228
265
  viewBox="0 0 324 324" fill="none" xmlns="http://www.w3.org/2000/svg"
229
266
  style="margin-top:-1px; height: 1.2em; width: 1.2em;"
@@ -254,7 +291,12 @@ const time = computed(() => {
254
291
  </button>
255
292
  </template>
256
293
  </div>
257
- <FrameBox ref="frameBox" :client="client" :style="iframeStyle" />
294
+ <FrameBox
295
+ ref="frameBox"
296
+ :client="client"
297
+ :style="iframeStyle"
298
+ :is-dragging="isDragging"
299
+ />
258
300
  </div>
259
301
  </template>
260
302
 
@@ -265,6 +307,18 @@ const time = computed(() => {
265
307
  position: fixed;
266
308
  transform-origin: center center;
267
309
  transform: translate(-50%, -50%) rotate(0);
310
+ font-family: Arial, Helvetica, sans-serif;
311
+ font-size: 15px !important;
312
+ }
313
+
314
+ #nuxt-devtools-anchor button {
315
+ border: none;
316
+ background: none;
317
+ padding: 0;
318
+ margin: 0;
319
+ cursor: pointer;
320
+ outline: none;
321
+ color: inherit;
268
322
  }
269
323
 
270
324
  #nuxt-devtools-anchor .nuxt-devtools-label {
@@ -1,3 +1,11 @@
1
1
  import type { Ref } from 'vue';
2
+ import type { NuxtDevtoolsHostClient } from '../../../types';
3
+ declare const clientRef: import("vue").ShallowRef<NuxtDevtoolsHostClient | undefined>;
4
+ export { clientRef as client };
2
5
  export type ColorScheme = 'dark' | 'light';
6
+ export declare function setupDevToolsClient({ nuxt, clientHooks, timeMetric, }: {
7
+ nuxt: any;
8
+ clientHooks: any;
9
+ timeMetric: any;
10
+ }): Promise<void>;
3
11
  export declare function useClientColorMode(): Ref<ColorScheme>;
@@ -1,4 +1,212 @@
1
- import { computed, ref } from "vue";
1
+ import { computed, createApp, h, markRaw, nextTick, ref, shallowReactive, shallowRef, watch } from "vue";
2
+ import { createHooks } from "hookable";
3
+ import Main from "./Main.vue";
4
+ import { popupWindow, state } from "./state.mjs";
5
+ import { useAppConfig } from "#imports";
6
+ const clientRef = shallowRef();
7
+ export { clientRef as client };
8
+ export async function setupDevToolsClient({
9
+ nuxt,
10
+ clientHooks,
11
+ timeMetric
12
+ }) {
13
+ const isInspecting = ref(false);
14
+ const colorMode = useClientColorMode();
15
+ const client = shallowReactive({
16
+ nuxt: markRaw(nuxt),
17
+ appConfig: useAppConfig(),
18
+ hooks: createHooks(),
19
+ getClientHooksMetrics: () => Object.values(clientHooks),
20
+ getClientPluginMetrics: () => {
21
+ return window.__NUXT_DEVTOOLS_PLUGINS_METRIC__ || [];
22
+ },
23
+ loadingTimeMetrics: timeMetric,
24
+ reloadPage() {
25
+ location.reload();
26
+ },
27
+ toggle() {
28
+ if (state.value.open)
29
+ client.close();
30
+ else
31
+ client.open();
32
+ },
33
+ close() {
34
+ if (!state.value.open)
35
+ return;
36
+ state.value.open = false;
37
+ if (popupWindow.value) {
38
+ try {
39
+ popupWindow.value.close();
40
+ } catch (e) {
41
+ }
42
+ popupWindow.value = null;
43
+ }
44
+ },
45
+ open() {
46
+ if (state.value.open)
47
+ return;
48
+ state.value.open = true;
49
+ nextTick(() => {
50
+ client.updateClient();
51
+ });
52
+ },
53
+ inspector: getInspectorInstance(),
54
+ colorMode,
55
+ getIframe,
56
+ updateClient
57
+ });
58
+ let iframe;
59
+ function updateClient() {
60
+ if (!client.inspector)
61
+ client.inspector = getInspectorInstance();
62
+ try {
63
+ iframe?.contentWindow?.__NUXT_DEVTOOLS_VIEW__?.setClient(client);
64
+ } catch (e) {
65
+ }
66
+ return client;
67
+ }
68
+ function getIframe() {
69
+ if (!iframe) {
70
+ const CLIENT_PATH = "/__nuxt_devtools__/client";
71
+ const initialUrl = CLIENT_PATH + state.value.route;
72
+ iframe = document.createElement("iframe");
73
+ iframe.id = "nuxt-devtools-iframe";
74
+ iframe.src = initialUrl;
75
+ iframe.setAttribute("data-v-inspector-ignore", "true");
76
+ iframe.onload = async () => {
77
+ await waitForClientInjection();
78
+ client.updateClient();
79
+ };
80
+ }
81
+ return iframe;
82
+ }
83
+ function waitForClientInjection(retry = 10, timeout = 200) {
84
+ const test = () => !!iframe?.contentWindow?.__NUXT_DEVTOOLS_VIEW__;
85
+ if (test())
86
+ return;
87
+ return new Promise((resolve, reject) => {
88
+ const interval = setInterval(() => {
89
+ if (test()) {
90
+ clearInterval(interval);
91
+ resolve();
92
+ } else if (retry-- <= 0) {
93
+ clearInterval(interval);
94
+ reject("Nuxt Devtools client injection failed");
95
+ }
96
+ }, timeout);
97
+ });
98
+ }
99
+ function enableComponentInspector() {
100
+ window.__VUE_INSPECTOR__?.enable();
101
+ isInspecting.value = true;
102
+ }
103
+ function disableComponentInspector() {
104
+ if (!window.__VUE_INSPECTOR__?.enabled)
105
+ return;
106
+ window.__VUE_INSPECTOR__?.disable();
107
+ client?.hooks.callHook("host:inspector:close");
108
+ isInspecting.value = false;
109
+ }
110
+ function getInspectorInstance() {
111
+ const componentInspector = window.__VUE_INSPECTOR__;
112
+ if (componentInspector) {
113
+ componentInspector.openInEditor = async (baseUrl, file, line, column) => {
114
+ disableComponentInspector();
115
+ await client.hooks.callHook("host:inspector:click", baseUrl, file, line, column);
116
+ };
117
+ componentInspector.onUpdated = () => {
118
+ client.hooks.callHook("host:inspector:update", {
119
+ ...componentInspector.linkParams,
120
+ ...componentInspector.position
121
+ });
122
+ };
123
+ }
124
+ return markRaw({
125
+ isEnabled: isInspecting,
126
+ enable: enableComponentInspector,
127
+ disable: disableComponentInspector,
128
+ toggle: () => {
129
+ if (window.__VUE_INSPECTOR__?.enabled)
130
+ disableComponentInspector();
131
+ else
132
+ enableComponentInspector();
133
+ },
134
+ instance: componentInspector
135
+ });
136
+ }
137
+ function refreshReactivity() {
138
+ client.hooks.callHook("host:update:reactivity");
139
+ }
140
+ watch(() => [
141
+ client.nuxt.payload,
142
+ client.colorMode.value,
143
+ client.loadingTimeMetrics
144
+ ], () => {
145
+ refreshReactivity();
146
+ }, { deep: true });
147
+ client.nuxt.vueApp.config.globalProperties?.$router?.afterEach(() => {
148
+ refreshReactivity();
149
+ });
150
+ client.nuxt.hook("app:mounted", () => {
151
+ refreshReactivity();
152
+ });
153
+ client.hooks.hook("devtools:navigate", (path) => {
154
+ state.value.route = path;
155
+ });
156
+ clientRef.value = client;
157
+ const documentPictureInPicture = window.documentPictureInPicture;
158
+ if (documentPictureInPicture?.requestWindow) {
159
+ client.popup = async () => {
160
+ const iframe2 = getIframe();
161
+ const pip = popupWindow.value = await documentPictureInPicture.requestWindow({
162
+ width: Math.round(window.innerWidth * state.value.width / 100),
163
+ height: Math.round(window.innerHeight * state.value.height / 100)
164
+ });
165
+ const style = pip.document.createElement("style");
166
+ style.innerHTML = `
167
+ body {
168
+ margin: 0;
169
+ padding: 0;
170
+ }
171
+ iframe {
172
+ width: 100vw;
173
+ height: 100vh;
174
+ border: none;
175
+ outline: none;
176
+ }
177
+ `;
178
+ pip.__NUXT_DEVTOOLS_DISABLE__ = true;
179
+ pip.__NUXT_DEVTOOLS_IS_POPUP__ = true;
180
+ pip.document.title = "Nuxt DevTools";
181
+ pip.document.head.appendChild(style);
182
+ pip.document.body.appendChild(iframe2);
183
+ pip.addEventListener("resize", () => {
184
+ state.value.width = Math.round(pip.innerWidth / window.innerWidth * 100);
185
+ state.value.height = Math.round(pip.innerHeight / window.innerHeight * 100);
186
+ });
187
+ pip.addEventListener("pagehide", () => {
188
+ popupWindow.value = null;
189
+ pip.close();
190
+ });
191
+ };
192
+ }
193
+ client.updateClient();
194
+ const holder = document.createElement("div");
195
+ holder.id = "nuxt-devtools-container";
196
+ holder.setAttribute("data-v-inspector-ignore", "true");
197
+ document.body.appendChild(holder);
198
+ addEventListener("keydown", (e) => {
199
+ if (e.code === "KeyD" && e.altKey && e.shiftKey)
200
+ client.close();
201
+ });
202
+ const app = createApp({
203
+ render: () => h(Main, { client }),
204
+ devtools: {
205
+ hide: true
206
+ }
207
+ });
208
+ app.mount(holder);
209
+ }
2
210
  export function useClientColorMode() {
3
211
  const explicitColor = ref();
4
212
  const systemColor = ref();
@@ -2,8 +2,5 @@ import type { DevToolsFrameState } from '../../../types';
2
2
  export declare const PANEL_PADDING = 10;
3
3
  export declare const PANEL_MIN = 20;
4
4
  export declare const PANEL_MAX = 100;
5
+ export declare const popupWindow: import("vue").ShallowRef<Window | null>;
5
6
  export declare const state: import("vue").Ref<DevToolsFrameState>;
6
- export declare const isInitialized: import("vue").Ref<boolean>;
7
- export declare function togglePanel(): void;
8
- export declare function closePanel(): void;
9
- export declare function openPanel(): void;
@@ -1,8 +1,9 @@
1
- import { ref, watch } from "vue";
1
+ import { shallowRef } from "vue";
2
2
  import { useObjectStorage } from "./utils.mjs";
3
3
  export const PANEL_PADDING = 10;
4
4
  export const PANEL_MIN = 20;
5
5
  export const PANEL_MAX = 100;
6
+ export const popupWindow = shallowRef(null);
6
7
  export const state = useObjectStorage("nuxt-devtools-frame-state", {
7
8
  width: 80,
8
9
  height: 60,
@@ -13,22 +14,3 @@ export const state = useObjectStorage("nuxt-devtools-frame-state", {
13
14
  position: "bottom",
14
15
  closeOnOutsideClick: false
15
16
  });
16
- export const isInitialized = ref(state.value.open);
17
- if (!isInitialized.value) {
18
- watch(() => state.value.open, (open) => {
19
- if (open)
20
- isInitialized.value = open;
21
- });
22
- }
23
- export function togglePanel() {
24
- if (state.value.open)
25
- closePanel();
26
- else
27
- openPanel();
28
- }
29
- export function closePanel() {
30
- state.value.open = false;
31
- }
32
- export function openPanel() {
33
- state.value.open = true;
34
- }
@@ -3,3 +3,15 @@ export declare function useObjectStorage<T>(key: string, initial: T, readonly?:
3
3
  export declare function useTransform<F, T>(data: Ref<F>, to: (data: F) => T, from: (data: T) => F): Ref<T>;
4
4
  export declare function useEventListener(target: EventTarget, type: string, listener: any, options?: boolean | AddEventListenerOptions): void;
5
5
  export declare function millisecondToHumanreadable(ms: number): [number, string];
6
+ /**
7
+ * Reactive `env(safe-area-inset-*)`
8
+ *
9
+ * @see https://vueuse.org/useScreenSafeArea
10
+ */
11
+ export declare function useScreenSafeArea(): {
12
+ top: Ref<number>;
13
+ right: Ref<number>;
14
+ bottom: Ref<number>;
15
+ left: Ref<number>;
16
+ update: () => void;
17
+ };
@@ -48,3 +48,35 @@ export function millisecondToHumanreadable(ms) {
48
48
  return [+(ms / 1e3 / 60).toFixed(1), "min"];
49
49
  return [+(ms / 1e3 / 60 / 60).toFixed(1), "hour"];
50
50
  }
51
+ const topVarName = "--nuxt-devtools-safe-area-top";
52
+ const rightVarName = "--nuxt-devtools-safe-area-right";
53
+ const bottomVarName = "--nuxt-devtools-safe-area-bottom";
54
+ const leftVarName = "--nuxt-devtools-safe-area-left";
55
+ export function useScreenSafeArea() {
56
+ const top = ref(0);
57
+ const right = ref(0);
58
+ const bottom = ref(0);
59
+ const left = ref(0);
60
+ document.documentElement.style.setProperty(topVarName, "env(safe-area-inset-top, 0px)");
61
+ document.documentElement.style.setProperty(rightVarName, "env(safe-area-inset-right, 0px)");
62
+ document.documentElement.style.setProperty(bottomVarName, "env(safe-area-inset-bottom, 0px)");
63
+ document.documentElement.style.setProperty(leftVarName, "env(safe-area-inset-left, 0px)");
64
+ update();
65
+ useEventListener(window, "resize", update);
66
+ function getValue(position) {
67
+ return Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue(position)) || 0;
68
+ }
69
+ function update() {
70
+ top.value = getValue(topVarName);
71
+ right.value = getValue(rightVarName);
72
+ bottom.value = getValue(bottomVarName);
73
+ left.value = getValue(leftVarName);
74
+ }
75
+ return {
76
+ top,
77
+ right,
78
+ bottom,
79
+ left,
80
+ update
81
+ };
82
+ }
package/dist/types.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ import './global-20ccb74c.js';
1
2
  import { ModuleStaticInfo } from '@nuxt/devtools-kit/types';
2
3
  export * from '@nuxt/devtools-kit/types';
4
+ import 'vite-plugin-vue-inspector';
3
5
 
4
6
  interface DevToolsFrameState {
5
7
  width: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools",
3
3
  "type": "module",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "license": "MIT",
6
6
  "repository": "nuxt/devtools",
7
7
  "exports": {
@@ -30,12 +30,12 @@
30
30
  "vite": "*"
31
31
  },
32
32
  "dependencies": {
33
- "@nuxt/kit": "^3.5.3",
33
+ "@nuxt/kit": "^3.6.0",
34
34
  "birpc": "^0.2.12",
35
35
  "boxen": "^7.1.0",
36
36
  "consola": "^3.1.0",
37
37
  "execa": "^7.1.1",
38
- "fast-folder-size": "^2.0.0",
38
+ "fast-folder-size": "^2.1.0",
39
39
  "fast-glob": "^3.2.12",
40
40
  "get-port-please": "^3.0.1",
41
41
  "global-dirs": "^3.0.1",
@@ -53,16 +53,16 @@
53
53
  "picocolors": "^1.0.0",
54
54
  "pkg-types": "^1.0.3",
55
55
  "rc9": "^2.1.1",
56
- "semver": "^7.5.2",
56
+ "semver": "^7.5.3",
57
57
  "sirv": "^2.0.3",
58
58
  "unimport": "^3.0.8",
59
- "vite-plugin-inspect": "^0.7.28",
59
+ "vite-plugin-inspect": "^0.7.29",
60
60
  "vite-plugin-vue-inspector": "^3.4.2",
61
61
  "wait-on": "^7.0.1",
62
62
  "which": "^3.0.1",
63
63
  "ws": "^8.13.0",
64
- "@nuxt/devtools-kit": "0.6.2",
65
- "@nuxt/devtools-wizard": "0.6.2"
64
+ "@nuxt/devtools-kit": "0.6.4",
65
+ "@nuxt/devtools-wizard": "0.6.4"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@antfu/utils": "^0.7.4",
@@ -70,17 +70,17 @@
70
70
  "@iconify-json/carbon": "^1.1.18",
71
71
  "@iconify-json/logos": "^1.1.33",
72
72
  "@iconify-json/ri": "^1.1.10",
73
- "@iconify-json/simple-icons": "^1.1.57",
73
+ "@iconify-json/simple-icons": "^1.1.58",
74
74
  "@iconify-json/tabler": "^1.1.79",
75
75
  "@nuxt/content": "^2.7.0",
76
- "@nuxtjs/color-mode": "^3.2.0",
76
+ "@nuxtjs/color-mode": "^3.3.0",
77
77
  "@parcel/watcher": "^2.1.0",
78
78
  "@types/markdown-it-link-attributes": "^3.0.1",
79
79
  "@types/ua-parser-js": "^0.7.36",
80
- "@unocss/nuxt": "^0.53.1",
81
- "@unocss/preset-icons": "^0.53.1",
82
- "@unocss/preset-uno": "^0.53.1",
83
- "@unocss/runtime": "^0.53.1",
80
+ "@unocss/nuxt": "^0.53.4",
81
+ "@unocss/preset-icons": "^0.53.4",
82
+ "@unocss/preset-uno": "^0.53.4",
83
+ "@unocss/runtime": "^0.53.4",
84
84
  "@vueuse/nuxt": "^10.2.0",
85
85
  "esno": "^0.16.3",
86
86
  "flatted": "^3.2.7",
@@ -90,17 +90,17 @@
90
90
  "markdown-it": "^13.0.1",
91
91
  "markdown-it-link-attributes": "^4.0.1",
92
92
  "nanoid": "^4.0.2",
93
- "nuxt": "^3.5.3",
93
+ "nuxt": "^3.6.0",
94
94
  "nuxt-vitest": "^0.8.5",
95
95
  "ofetch": "^1.1.1",
96
96
  "ohash": "^1.1.2",
97
- "shiki": "^0.14.2",
97
+ "shiki": "^0.14.3",
98
98
  "shiki-es": "^0.2.0",
99
- "simple-git": "^3.19.0",
99
+ "simple-git": "^3.19.1",
100
100
  "splitpanes": "^3.1.5",
101
101
  "theme-vitesse": "^0.7.2",
102
102
  "ua-parser-js": "^1.0.35",
103
- "unocss": "^0.53.1",
103
+ "unocss": "^0.53.4",
104
104
  "vanilla-jsoneditor": "^0.17.8",
105
105
  "vis-data": "^7.1.6",
106
106
  "vis-network": "^9.1.6",
@@ -109,7 +109,7 @@
109
109
  "vue-virtual-scroller": "2.0.0-beta.8",
110
110
  "xterm": "^5.2.1",
111
111
  "xterm-addon-fit": "^0.7.0",
112
- "@nuxt/devtools": "0.6.2"
112
+ "@nuxt/devtools": "0.6.4"
113
113
  },
114
114
  "scripts": {
115
115
  "build": "pnpm dev:prepare && pnpm build:module && pnpm build:client && esno scripts/prepare.ts",
@@ -1 +0,0 @@
1
- import{a as b,a3 as x,an as n,bd as _,y as l,r as m,u as c,c as g,w as d,Z as w,o as A,f as s,b as e,j as i,H as N,aO as T,aV as V,be as q,h as B,J as C,a6 as D}from"./entry.f3de3eb8.js";import{_ as P}from"./NIconButton.vue.e211c1b6.js";import{_ as $}from"./NPanelGrids.fc7166ff.js";const I=e("h3",{class:"mb2 text-lg font-medium leading-6",flex:"~ items-center gap-1","text-orange":""},[e("span",{class:"i-carbon-information-square"}),i(" Permissions required ")],-1),K=e("p",null," This operation requires permissions for running command and access files from the browser. ",-1),S=e("p",null,[i(" A request is sent to the server."),e("br"),i(" Please check your terminal for the instructions and then come back. ")],-1),j={flex:"~ gap-3",mt2:"","justify-end":""},F=e("p",null,"Or you can manually paste the token here:",-1),M=["onSubmit"],G=b({__name:"AuthRequiredPanel",setup(O){x(async()=>{n.value||_.value&&await l.verifyAuthToken(_.value)&&(n.value=!0),n.value||l.requestForAuth()});const o=m(""),r=m(!1);async function u(){const t=o.value.trim();r.value=!1,await l.verifyAuthToken(t).then(a=>{a?(n.value=!0,q(t)):r.value=!0})}return(t,a)=>{const f=B,p=C,h=P,v=D,k=$;return("isDevAuthed"in t?t.isDevAuthed:c(n))?w(t.$slots,"default",{key:1}):(A(),g(k,{key:0},{default:d(()=>[s(v,{flex:"~ col gap-2",mxa:"","items-center":"",p6:"","text-center":""},{default:d(()=>[I,K,S,e("div",j,[s(f,{disabled:"",icon:"i-carbon-time"},{default:d(()=>[i(" Waiting for authorization... ")]),_:1})]),F,e("form",{flex:"~ inline gap-2 items-center",onSubmit:V(u,["prevent"])},[s(p,{modelValue:c(o),"onUpdate:modelValue":a[0]||(a[0]=y=>N(o)?o.value=y:null),placeholder:"Enter token here",n:c(r)?"red":void 0,onKeydown:T(u,["enter"])},null,8,["modelValue","n","onKeydown"]),s(h,{icon:"i-carbon-arrow-right",onClick:u})],40,M)]),_:1})]),_:1}))}}});export{G as _};
@@ -1 +0,0 @@
1
- import{aY as n,o,e as s,Z as t}from"./entry.f3de3eb8.js";const c={},r={class:"mx-0.5 select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs"};function a(e,_){return o(),s("span",r,[t(e.$slots,"default")])}const l=n(c,[["render",a]]);export{l as _};
@@ -1 +0,0 @@
1
- import{_ as C}from"./NCodeBlock.vue.de2cd5a6.js";import{a as g,b3 as h,aj as S,o as s,e as a,b as n,F as d,m as w,p as u,u as o,t as x,f as _,w as f,j as m,c as B,q as r,h as N}from"./entry.f3de3eb8.js";import{a as V}from"./editor.24e006dd.js";const $={key:0,relative:"","n-code-block":""},j={flex:"~ wrap","w-full":""},D=["onClick"],E=n("div",{border:"b base","flex-auto":""},null,-1),F={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},T=g({__name:"CodeSnippets",props:{codeSnippets:{}},setup(b){const c=b,e=h(c.codeSnippets[0]),k=V();return S(()=>{c.codeSnippets.includes(e.value)||(e.value=c.codeSnippets[0])}),(l,p)=>{const v=C,i=N;return l.codeSnippets.length?(s(),a("div",$,[n("div",j,[(s(!0),a(d,null,w(l.codeSnippets,(t,y)=>(s(),a("button",{key:y,px4:"",py2:"",border:"r base",hover:"bg-active",class:u(t===o(e)?"":"border-b"),onClick:q=>e.value=t},[n("div",{class:u(t===o(e)?"":"op30"),"font-mono":""},x(t.name),3)],10,D))),128)),E]),o(e)?(s(),a(d,{key:0},[_(v,{code:o(e).code,lang:o(e).lang,lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),n("div",F,[_(i,{icon:"carbon-copy",onClick:p[0]||(p[0]=t=>o(k)(o(e).code))},{default:f(()=>[m(" Copy ")]),_:1}),o(e)?.docs?(s(),B(i,{key:0,to:o(e).docs,target:"_blank",icon:"carbon-catalog"},{default:f(()=>[m(" Docs ")]),_:1},8,["to"])):r("",!0)])],64)):r("",!0)])):r("",!0)}}});export{T as _};
@@ -1 +0,0 @@
1
- import{_ as i}from"./NIconButton.vue.e211c1b6.js";import{a as u,r as f,ac as m,ad as d,c as p,w as _,ae as b,o as s,e as v,f as g,b as h,Z as x,af as y,u as k,q as B}from"./entry.f3de3eb8.js";const C={relative:"","h-full":"","w-full":"","of-auto":""},V={inheritAttrs:!1},N=u({...V,__name:"DrawerRight",props:{modelValue:{type:Boolean},navbar:{},autoClose:{type:Boolean}},emits:["close"],setup(r,{emit:l}){const t=r,o=f(),{height:n}=m(()=>t.navbar,void 0,{box:"border-box"});return d(o,()=>{t.modelValue&&t.autoClose&&l("close")},{ignore:["a","button","summary"]}),(e,a)=>{const c=i;return s(),p(b,{"enter-active-class":"duration-200 ease-in","enter-from-class":"transform translate-x-1/1","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-out","leave-from-class":"opacity-100","leave-to-class":"transform translate-x-1/1"},{default:_(()=>[e.modelValue?(s(),v("div",y({key:0,ref_key:"el",ref:o,border:"l base",flex:"~ col gap-1",absolute:"","bottom-0":"","right-0":"","z-10":"","z-20":"","of-auto":"","text-sm":"","glass-effect":"",style:{top:`${k(n)}px`}},e.$attrs),[g(c,{absolute:"","right-2":"","top-2":"","z-20":"","text-xl":"",icon:"carbon-close",onClick:a[0]||(a[0]=$=>e.$emit("close"))}),h("div",C,[x(e.$slots,"default")])],16)):B("",!0)]),_:3})}}});export{N as _};
@@ -1 +0,0 @@
1
- import{a as n,o as s,e as i,j as u,t as f,p,b as c}from"./entry.f3de3eb8.js";const m=c("span",{"ml-1":"","text-xs":"",op50:""},"ms",-1),l=n({__name:"DurationDisplay",props:{duration:{},factor:{default:1}},setup(r){const e=r;function o(t){return t?(t=t*e.factor,t<.5?"text-gray:50":t>1e3?"text-red-400":t>500?"text-orange-400":t>200?"text-yellow-400":""):"text-gray-400"}function a(t){return t?t<1?"<1":t.toFixed(2):"-"}return(t,d)=>(s(),i("div",{class:p(o(t.duration))},[u(f(a(t.duration)),1),m],2))}});export{l as _};
@@ -1 +0,0 @@
1
- import{u as h}from"./editor.24e006dd.js";import{a as f,U as c,l as k,at as v,o as t,c as y,w as B,e as s,F as l,j as m,t as n,u as a,b as C,q as b,p as N,ab as g}from"./entry.f3de3eb8.js";const w={key:0,op50:""},I=f({__name:"FilepathItem",props:{filepath:{},lineBreak:{type:Boolean},subpath:{type:Boolean},override:{}},setup(u){const r=u,d=h(),p=c(),o=k(()=>r.filepath&&p.value?v(r.filepath,p.value.rootDir):{path:r.filepath||""});return(e,i)=>(t(),y(g(e.filepath?"button":"span"),{class:N([e.filepath?"hover:underline":"",e.lineBreak?"":"ws-nowrap of-hidden truncate"]),"font-mono":"",title:e.override||e.filepath,onClick:i[0]||(i[0]=D=>e.filepath&&a(d)(e.filepath))},{default:B(()=>[e.override?(t(),s(l,{key:0},[m(n(e.override),1)],64)):a(o).moduleName?(t(),s(l,{key:1},[C("span",null,n(a(o).moduleName),1),e.subpath?(t(),s("span",w,n(a(o).path.slice(a(o).moduleName.length)),1)):b("",!0)],64)):(t(),s(l,{key:2},[m(n(a(o).path),1)],64))]),_:1},8,["class","title"]))}});export{I as _};
@@ -1 +0,0 @@
1
- import{_ as f}from"./NIconButton.vue.e211c1b6.js";import{a as _,r as m,u as o,e as s,b as d,f as a,w as i,ae as u,F as v,q as n,o as l,Z as g,a5 as k}from"./entry.f3de3eb8.js";const x=d("div",{"i-ri:question-mark":""},null,-1),h=[x],y={key:0,border:"l base",class:"prose",pos:"fixed bottom-0 right-0 top-0","z-200":"","w-150":"",px8:"",py4:"","bg-base":""},$=_({__name:"HelpFab",setup(w){const e=m(!1),{showHelpButtons:p}=k();return(b,t)=>{const c=f;return o(p)?(l(),s(v,{key:0},[d("button",{pos:"absolute bottom-5 right-5",border:"~ base rounded-full ",flex:"~ items-center justify-center","z-110":"","h-11":"","w-11":"","backdrop-blur-8":"",bg:"bg-base op50!","light:shadow":"",hover:"bg-active",title:"Help",onClick:t[0]||(t[0]=r=>e.value=!o(e))},h),a(u,{name:"fade-in"},{default:i(()=>[o(e)?(l(),s("div",{key:0,class:"fixed bottom-0 left-0 right-0 top-0 z-100","bg-black:20":"","backdrop-blur-2":"",onClick:t[1]||(t[1]=r=>e.value=!1)})):n("",!0)]),_:1}),a(u,{name:"slide-in"},{default:i(()=>[o(e)?(l(),s("div",y,[g(b.$slots,"default"),a(c,{icon:"carbon-close",pos:"absolute top-3 right-3","rounded-full":"","text-xl":"",onClick:t[2]||(t[2]=r=>e.value=!1)})])):n("",!0)]),_:3})],64)):n("",!0)}}});export{$ as _};
@@ -1 +0,0 @@
1
- import{a as i,ar as r,e as p,v as b,bj as u,u as a,b as n,H as h,aO as k,f,Z as m,p as v,o as _,P as x}from"./entry.f3de3eb8.js";const V=["checked","disabled"],y=["disabled"],B={class:"n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},$=i({__name:"NCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(c,{emit:t}){const e=r(c,"modelValue",t,{passive:!0});return(o,s)=>{const d=x;return _(),p("label",{class:"n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled",checked:a(e)||null,disabled:o.disabled||null},[b(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>h(e)?e.value=l:null),type:"checkbox",class:"peer absolute op0",disabled:o.disabled,onKeypress:s[1]||(s[1]=k(l=>e.value=!a(e),["enter"]))},null,40,y),[[u,a(e)]]),n("span",B,[f(d,{class:"n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100"})]),n("span",{class:v([a(e)?"":"op50","n-transition"])},[m(o.$slots,"default")],2)],8,V)}}});export{$ as _};