@nuxt/devtools-ui-kit 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/styles.css +78 -0
- package/dist/components/NCheckbox.vue +1 -1
- package/dist/components/NCodeBlock.vue +13 -2
- package/dist/components/NDarkToggle.vue +50 -3
- package/dist/components/NDialog.vue +1 -1
- package/dist/components/NDropdown.vue +1 -1
- package/dist/components/NLink.vue +1 -1
- package/dist/components/NRadio.vue +1 -1
- package/dist/components/NSectionBlock.vue +2 -1
- package/dist/components/NSwitch.vue +1 -1
- package/dist/components/NTextExternalLink.vue +24 -0
- package/dist/module.json +1 -1
- package/dist/runtime/client.d.ts +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/unocss.mjs +7 -4
- package/package.json +17 -17
package/dist/assets/styles.css
CHANGED
|
@@ -11,3 +11,81 @@ html.dark {
|
|
|
11
11
|
background-color: #151515;
|
|
12
12
|
color: white;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
::selection {
|
|
16
|
+
background: #8884;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Shiki */
|
|
20
|
+
.shiki .line {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.shiki.diff .line > span {
|
|
27
|
+
opacity: 0.75;
|
|
28
|
+
filter: saturate(0.75);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.shiki.diff .line-added,
|
|
32
|
+
.shiki.diff .line-removed {
|
|
33
|
+
scroll-margin: 5em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.shiki.diff .line-added > span,
|
|
37
|
+
.shiki.diff .line-removed > span {
|
|
38
|
+
opacity: 1 !important;
|
|
39
|
+
z-index: 100;
|
|
40
|
+
position: inherit;
|
|
41
|
+
scroll-margin: 20px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.shiki.diff .line-added > span {
|
|
45
|
+
color: #218c3b !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.shiki.diff .line-removed > span {
|
|
49
|
+
color: #8c2c21 !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.shiki .line-added:after {
|
|
53
|
+
content: "";
|
|
54
|
+
background-color: #43885440;
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
top: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.shiki .line-removed:after {
|
|
64
|
+
content: "";
|
|
65
|
+
background-color: #8f4b3950;
|
|
66
|
+
display: block;
|
|
67
|
+
position: absolute;
|
|
68
|
+
left: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
top: 0;
|
|
71
|
+
bottom: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Color Mode transition */
|
|
75
|
+
::view-transition-old(root),
|
|
76
|
+
::view-transition-new(root) {
|
|
77
|
+
animation: none;
|
|
78
|
+
mix-blend-mode: normal;
|
|
79
|
+
}
|
|
80
|
+
::view-transition-old(root) {
|
|
81
|
+
z-index: 1;
|
|
82
|
+
}
|
|
83
|
+
::view-transition-new(root) {
|
|
84
|
+
z-index: 2147483646;
|
|
85
|
+
}
|
|
86
|
+
.dark::view-transition-old(root) {
|
|
87
|
+
z-index: 2147483646;
|
|
88
|
+
}
|
|
89
|
+
.dark::view-transition-new(root) {
|
|
90
|
+
z-index: 1;
|
|
91
|
+
}
|
|
@@ -16,7 +16,7 @@ const checked = useVModel(props, 'modelValue', emit, { passive: true })
|
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
18
|
<label
|
|
19
|
-
class="hover:n-checkbox-hover
|
|
19
|
+
class="n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled"
|
|
20
20
|
:checked="checked || null"
|
|
21
21
|
:disabled="disabled || null"
|
|
22
22
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// This components requires to run in DevTools to render correctly
|
|
3
|
-
import { computed } from 'vue'
|
|
3
|
+
import { computed, nextTick } from 'vue'
|
|
4
4
|
import { devToolsClient } from '../runtime/client'
|
|
5
5
|
|
|
6
6
|
const props = withDefaults(
|
|
@@ -8,11 +8,22 @@ const props = withDefaults(
|
|
|
8
8
|
code: string
|
|
9
9
|
lang?: string
|
|
10
10
|
lines?: boolean
|
|
11
|
+
transformRendered?: (code: string) => string
|
|
11
12
|
}>(), {
|
|
12
13
|
lines: true,
|
|
13
14
|
},
|
|
14
15
|
)
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits(['loaded'])
|
|
18
|
+
|
|
19
|
+
const rendered = computed(() => {
|
|
20
|
+
const result = devToolsClient.value?.devtools.renderCodeHighlight(props.code, props.lang as string) || { code: props.code, supported: false }
|
|
21
|
+
if (result.supported && props.transformRendered)
|
|
22
|
+
result.code = props.transformRendered(result.code)
|
|
23
|
+
if (result.supported)
|
|
24
|
+
nextTick(() => emit('loaded'))
|
|
25
|
+
return result
|
|
26
|
+
})
|
|
16
27
|
</script>
|
|
17
28
|
|
|
18
29
|
<template>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import { useToggle } from '@vueuse/core'
|
|
2
|
+
import { computed, nextTick } from 'vue'
|
|
4
3
|
|
|
5
4
|
// @ts-expect-error auto imported from @nuxtjs/color-mode
|
|
6
5
|
import { useColorMode } from '#imports'
|
|
@@ -14,7 +13,55 @@ const isDark = computed<boolean>({
|
|
|
14
13
|
mode.preference = isDark.value ? 'light' : 'dark'
|
|
15
14
|
},
|
|
16
15
|
})
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
const isAppearanceTransition = typeof document !== 'undefined'
|
|
18
|
+
// @ts-expect-error: Transition API
|
|
19
|
+
&& document.startViewTransition
|
|
20
|
+
&& !window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Credit to [@hooray](https://github.com/hooray)
|
|
24
|
+
* @see https://github.com/vuejs/vitepress/pull/2347
|
|
25
|
+
*/
|
|
26
|
+
function toggle(event?: MouseEvent) {
|
|
27
|
+
if (!isAppearanceTransition || !event) {
|
|
28
|
+
isDark.value = !isDark.value
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const x = event.clientX
|
|
33
|
+
const y = event.clientY
|
|
34
|
+
const endRadius = Math.hypot(
|
|
35
|
+
Math.max(x, innerWidth - x),
|
|
36
|
+
Math.max(y, innerHeight - y),
|
|
37
|
+
)
|
|
38
|
+
// @ts-expect-error: Transition API
|
|
39
|
+
const transition = document.startViewTransition(async () => {
|
|
40
|
+
isDark.value = !isDark.value
|
|
41
|
+
await nextTick()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
transition.ready.then(() => {
|
|
45
|
+
const clipPath = [
|
|
46
|
+
`circle(0px at ${x}px ${y}px)`,
|
|
47
|
+
`circle(${endRadius}px at ${x}px ${y}px)`,
|
|
48
|
+
]
|
|
49
|
+
document.documentElement.animate(
|
|
50
|
+
{
|
|
51
|
+
clipPath: isDark.value
|
|
52
|
+
? [...clipPath].reverse()
|
|
53
|
+
: clipPath,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
duration: 400,
|
|
57
|
+
easing: 'ease-in',
|
|
58
|
+
pseudoElement: isDark.value
|
|
59
|
+
? '::view-transition-old(root)'
|
|
60
|
+
: '::view-transition-new(root)',
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
})
|
|
64
|
+
}
|
|
18
65
|
const context = {
|
|
19
66
|
mode,
|
|
20
67
|
isDark,
|
|
@@ -15,7 +15,7 @@ onClickOutside(el, () => {
|
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
17
|
<div ref="el" class="relative">
|
|
18
|
-
<slot name="trigger" :enabled="enabled"
|
|
18
|
+
<slot name="trigger" :enabled="enabled" :click="() => enabled = !enabled">
|
|
19
19
|
<NButton @click="enabled = !enabled">
|
|
20
20
|
Dropdown
|
|
21
21
|
</NButton>
|
|
@@ -19,7 +19,7 @@ const model = useVModel(props, 'modelValue', emit, { passive: true })
|
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
21
|
<label
|
|
22
|
-
class="n-radio hover:n-radio-hover
|
|
22
|
+
class="n-radio inline-flex hover:n-radio-hover select-none items-center n-disabled:n-disabled"
|
|
23
23
|
:checked="model === value || null"
|
|
24
24
|
:disabled="disabled || null"
|
|
25
25
|
>
|
|
@@ -7,6 +7,7 @@ const props = withDefaults(
|
|
|
7
7
|
text: string
|
|
8
8
|
description?: string
|
|
9
9
|
containerClass?: string
|
|
10
|
+
headerClass?: string
|
|
10
11
|
collapse?: boolean
|
|
11
12
|
open?: boolean
|
|
12
13
|
padding?: boolean | string
|
|
@@ -27,7 +28,7 @@ function onToggle(e: any) {
|
|
|
27
28
|
<template>
|
|
28
29
|
<details :open="open" @toggle="onToggle">
|
|
29
30
|
<summary class="cursor-pointer select-none hover:bg-active p4" :class="collapse ? '' : 'pointer-events-none'">
|
|
30
|
-
<NIconTitle :icon="icon" :text="text" text-xl transition :class="open ? 'op100' : 'op60'">
|
|
31
|
+
<NIconTitle :icon="icon" :text="text" text-xl transition :class="[open ? 'op100' : 'op60', headerClass]">
|
|
31
32
|
<div>
|
|
32
33
|
<div text-base>
|
|
33
34
|
<slot name="text">
|
|
@@ -16,7 +16,7 @@ const checked = useVModel(props, 'modelValue', emit, { passive: true })
|
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
18
|
<label
|
|
19
|
-
class="n-switch n-switch-base n-disabled:n-disabled"
|
|
19
|
+
class="n-switch n-switch-base hover:n-switch-hover n-disabled:n-disabled"
|
|
20
20
|
:checked="checked || null"
|
|
21
21
|
:disabled="disabled || null"
|
|
22
22
|
>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import NLink from './NLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
link?: string
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<component
|
|
11
|
+
:is="link ? NLink : 'div'"
|
|
12
|
+
v-bind="link ? {
|
|
13
|
+
href: link,
|
|
14
|
+
target: '_blank',
|
|
15
|
+
rel: 'noopener noreferrer',
|
|
16
|
+
} : {}"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
<div
|
|
20
|
+
v-if="link"
|
|
21
|
+
i-carbon:arrow-up-right translate-y--1 text-xs op50
|
|
22
|
+
/>
|
|
23
|
+
</component>
|
|
24
|
+
</template>
|
package/dist/module.json
CHANGED
package/dist/runtime/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const devToolsClient: import("vue").Ref<import("@nuxt/devtools-kit/dist/client-api-
|
|
1
|
+
export declare const devToolsClient: import("vue").Ref<import("@nuxt/devtools-kit/dist/client-api-dfe1af35").c | undefined>;
|
package/dist/types.d.ts
CHANGED
|
@@ -6,5 +6,10 @@ declare module '@nuxt/schema' {
|
|
|
6
6
|
interface NuxtOptions { ['devtoolsUIKit']?: ModuleOptions }
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
declare module 'nuxt/schema' {
|
|
10
|
+
interface NuxtConfig { ['devtoolsUIKit']?: Partial<ModuleOptions> }
|
|
11
|
+
interface NuxtOptions { ['devtoolsUIKit']?: ModuleOptions }
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
|
|
10
15
|
export { unocssPreset } from './module'
|
package/dist/unocss.mjs
CHANGED
|
@@ -83,7 +83,7 @@ function unocssPreset() {
|
|
|
83
83
|
"n-borderless": "!border-transparent !shadow-none",
|
|
84
84
|
// link
|
|
85
85
|
"n-link-base": "underline underline-offset-2 underline-black/20 dark:underline-white/40",
|
|
86
|
-
"n-link-hover": "decoration-dotted text-context underline-context",
|
|
86
|
+
"n-link-hover": "decoration-dotted text-context underline-context! op100!",
|
|
87
87
|
// card
|
|
88
88
|
"n-card-base": "border n-border-base rounded n-bg-base shadow-sm",
|
|
89
89
|
// header
|
|
@@ -94,17 +94,20 @@ function unocssPreset() {
|
|
|
94
94
|
"n-button-active": "n-active-base bg-context/5",
|
|
95
95
|
"n-button-icon": "-ml-0.2em mr-0.2em text-1.1em",
|
|
96
96
|
// checkbox
|
|
97
|
-
"n-checkbox": "inline-flex gap-1 items-center",
|
|
97
|
+
"n-checkbox": "inline-flex gap-1 items-center rounded",
|
|
98
|
+
"n-checkbox-hover": "op100 n-bg-hover cursor-pointer",
|
|
98
99
|
"n-checkbox-box": "border n-border-base w-1.1em h-1.1em mr-1 text-white flex flex-none items-center rounded-sm overflow-visible",
|
|
99
100
|
"n-checkbox-box-checked": "bg-context border-context",
|
|
100
101
|
"n-checkbox-icon": "carbon-checkmark w-1em h-1em m-auto",
|
|
101
102
|
// radio
|
|
102
|
-
"n-radio-box": "border n-border-base w-1.2em h-1.2em mr-1 text-white flex flex-none rounded-full overflow-visible",
|
|
103
|
+
"n-radio-box": "border rounded n-border-base w-1.2em h-1.2em mr-1 text-white flex flex-none rounded-full overflow-visible",
|
|
104
|
+
"n-radio-hover": "op100 n-bg-hover cursor-pointer",
|
|
103
105
|
"n-radio-box-checked": "border-context",
|
|
104
106
|
"n-radio-inner": "bg-context rounded-1/2 w-0 h-0 m-auto",
|
|
105
107
|
"n-radio-inner-checked": "w-0.8em h-0.8em",
|
|
106
108
|
// switch
|
|
107
|
-
"n-switch-base": "inline-flex items-center select-none",
|
|
109
|
+
"n-switch-base": "inline-flex items-center select-none rounded-full pe-2",
|
|
110
|
+
"n-switch-hover": "op100 n-bg-hover cursor-pointer",
|
|
108
111
|
"n-switch-slider": "mr-1 rounded-full border n-border-base relative p-2px",
|
|
109
112
|
"n-switch-slider-checked": "border-context/20 bg-context/10",
|
|
110
113
|
"n-switch-thumb": "h-1em w-1em rounded-1/2 border n-border-base ml-0 mr-0.8em",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/devtools-ui-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "nuxt/devtools",
|
|
7
7
|
"exports": {
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
"*.cjs"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@nuxt/devtools": "0.
|
|
26
|
+
"@nuxt/devtools": "0.5.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@iconify-json/carbon": "^1.1.16",
|
|
30
|
-
"@nuxt/kit": "^3.
|
|
30
|
+
"@nuxt/kit": "^3.5.0",
|
|
31
31
|
"@nuxtjs/color-mode": "^3.2.0",
|
|
32
|
-
"@unocss/core": "^0.51.
|
|
33
|
-
"@unocss/nuxt": "^0.51.
|
|
34
|
-
"@unocss/preset-attributify": "^0.51.
|
|
35
|
-
"@unocss/preset-icons": "^0.51.
|
|
36
|
-
"@unocss/preset-mini": "^0.51.
|
|
37
|
-
"@unocss/reset": "^0.51.
|
|
38
|
-
"@vueuse/core": "^10.1.
|
|
39
|
-
"@vueuse/integrations": "^10.1.
|
|
40
|
-
"@vueuse/nuxt": "^10.1.
|
|
32
|
+
"@unocss/core": "^0.51.13",
|
|
33
|
+
"@unocss/nuxt": "^0.51.13",
|
|
34
|
+
"@unocss/preset-attributify": "^0.51.13",
|
|
35
|
+
"@unocss/preset-icons": "^0.51.13",
|
|
36
|
+
"@unocss/preset-mini": "^0.51.13",
|
|
37
|
+
"@unocss/reset": "^0.51.13",
|
|
38
|
+
"@vueuse/core": "^10.1.2",
|
|
39
|
+
"@vueuse/integrations": "^10.1.2",
|
|
40
|
+
"@vueuse/nuxt": "^10.1.2",
|
|
41
41
|
"defu": "^6.1.2",
|
|
42
|
-
"focus-trap": "^7.4.
|
|
43
|
-
"unocss": "^0.51.
|
|
42
|
+
"focus-trap": "^7.4.1",
|
|
43
|
+
"unocss": "^0.51.13",
|
|
44
44
|
"v-lazy-show": "^0.2.3",
|
|
45
|
-
"@nuxt/devtools": "0.
|
|
46
|
-
"@nuxt/devtools-kit": "0.
|
|
45
|
+
"@nuxt/devtools": "0.5.0",
|
|
46
|
+
"@nuxt/devtools-kit": "0.5.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"nuxt": "^3.
|
|
49
|
+
"nuxt": "^3.5.0"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|