@nuxt/devtools-ui-kit 4.0.0-alpha.16 → 4.0.0-alpha.18
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/components/NBadgeHashed.vue +10 -6
- package/dist/components/NCheckbox.vue +10 -2
- package/dist/components/NCodeBlock.vue +37 -16
- package/dist/components/NDarkToggle.vue +34 -43
- package/dist/components/NDialog.vue +30 -23
- package/dist/components/NDrawer.vue +42 -24
- package/dist/components/NDropdown.vue +10 -3
- package/dist/components/NIcon.vue +16 -3
- package/dist/components/NIconTitle.vue +8 -2
- package/dist/components/NLink.vue +16 -4
- package/dist/components/NMarkdown.vue +9 -2
- package/dist/components/NNavbar.vue +9 -3
- package/dist/components/NNotification.vue +7 -1
- package/dist/components/NRadio.vue +18 -4
- package/dist/components/NSectionBlock.vue +38 -10
- package/dist/components/NSelect.vue +20 -4
- package/dist/components/NSelectTabs.vue +14 -3
- package/dist/components/NSplitPane.vue +25 -9
- package/dist/components/NSwitch.vue +7 -5
- package/dist/components/NTextInput.vue +39 -9
- package/dist/components/NTip.vue +4 -3
- package/dist/composables/iconify.d.ts +7 -0
- package/dist/composables/iconify.mjs +23 -0
- package/dist/module.json +1 -1
- package/package.json +15 -14
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { getHslColorFromStringHash } from "../composables/color";
|
|
4
4
|
import NBadge from "./NBadge.vue";
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const props = defineProps({ text: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
} });
|
|
8
9
|
const color = computed(() => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const foreground = getHslColorFromStringHash(props.text, 50, 60);
|
|
11
|
+
const background = getHslColorFromStringHash(props.text, 50, 60, .05);
|
|
12
|
+
return {
|
|
13
|
+
color: foreground,
|
|
14
|
+
background
|
|
15
|
+
};
|
|
12
16
|
});
|
|
13
17
|
</script>
|
|
14
18
|
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: [Boolean, null],
|
|
6
|
+
required: false,
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: false,
|
|
12
|
+
default: false
|
|
13
|
+
}
|
|
6
14
|
});
|
|
7
15
|
const emit = defineEmits([]);
|
|
8
16
|
const checked = useVModel(props, "modelValue", emit, { passive: true });
|
|
@@ -1,27 +1,48 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
// This components requires to run in DevTools to render correctly
|
|
2
3
|
import { computed, nextTick } from "vue";
|
|
3
4
|
import { devToolsClient } from "../runtime/client";
|
|
4
5
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
code: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
lang: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
lines: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
inline: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
grammarContextCode: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
transformRendered: {
|
|
28
|
+
type: Function,
|
|
29
|
+
required: false
|
|
30
|
+
}
|
|
11
31
|
});
|
|
12
32
|
const emit = defineEmits(["loaded"]);
|
|
13
33
|
const rendered = computed(() => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
const result = props.lang === "text" ? {
|
|
35
|
+
code: props.code,
|
|
36
|
+
supported: false
|
|
37
|
+
} : devToolsClient.value?.devtools.renderCodeHighlight(props.code, props.lang, { grammarContextCode: props.grammarContextCode }) || {
|
|
38
|
+
code: props.code,
|
|
39
|
+
supported: false
|
|
40
|
+
};
|
|
41
|
+
if (result.supported && props.transformRendered) result.code = props.transformRendered(result.code);
|
|
42
|
+
if (result.supported) nextTick(() => emit("loaded"));
|
|
43
|
+
return result;
|
|
20
44
|
});
|
|
21
|
-
const classes = computed(() => [
|
|
22
|
-
"n-code-block shiki",
|
|
23
|
-
props.lines && !props.inline ? "n-code-block-lines" : ""
|
|
24
|
-
]);
|
|
45
|
+
const classes = computed(() => ["n-code-block shiki", props.lines && !props.inline ? "n-code-block-lines" : ""]);
|
|
25
46
|
</script>
|
|
26
47
|
|
|
27
48
|
<template>
|
|
@@ -1,55 +1,46 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useColorMode } from "@vueuse/core";
|
|
3
3
|
import { computed, nextTick } from "vue";
|
|
4
|
-
const mode = useColorMode({
|
|
5
|
-
storageKey: "nuxt-devtools-color-mode"
|
|
6
|
-
});
|
|
4
|
+
const mode = useColorMode({ storageKey: "nuxt-devtools-color-mode" });
|
|
7
5
|
const isDark = computed({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
get() {
|
|
7
|
+
return mode.value === "dark";
|
|
8
|
+
},
|
|
9
|
+
set() {
|
|
10
|
+
mode.value = isDark.value ? "light" : "dark";
|
|
11
|
+
}
|
|
14
12
|
});
|
|
15
13
|
const isAppearanceTransition = typeof document !== "undefined" && document.startViewTransition && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
14
|
+
/**
|
|
15
|
+
* Credit to [@hooray](https://github.com/hooray)
|
|
16
|
+
* @see https://github.com/vuejs/vitepress/pull/2347
|
|
17
|
+
*/
|
|
16
18
|
function toggle(event) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
clipPath: isDark.value ? clipPath.toReversed() : clipPath
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
duration: 400,
|
|
42
|
-
easing: "ease-in",
|
|
43
|
-
fill: "forwards",
|
|
44
|
-
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
});
|
|
19
|
+
if (!isAppearanceTransition || !event) {
|
|
20
|
+
isDark.value = !isDark.value;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const x = event.clientX;
|
|
24
|
+
const y = event.clientY;
|
|
25
|
+
const endRadius = Math.hypot(Math.max(x, innerWidth - x), Math.max(y, innerHeight - y));
|
|
26
|
+
const transition = document.startViewTransition(async () => {
|
|
27
|
+
isDark.value = !isDark.value;
|
|
28
|
+
await nextTick();
|
|
29
|
+
});
|
|
30
|
+
transition.ready.then(() => {
|
|
31
|
+
const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`];
|
|
32
|
+
document.documentElement.animate({ clipPath: isDark.value ? clipPath.toReversed() : clipPath }, {
|
|
33
|
+
duration: 400,
|
|
34
|
+
easing: "ease-in",
|
|
35
|
+
fill: "forwards",
|
|
36
|
+
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
37
|
+
});
|
|
38
|
+
});
|
|
48
39
|
}
|
|
49
40
|
const context = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
mode,
|
|
42
|
+
isDark,
|
|
43
|
+
toggle
|
|
53
44
|
};
|
|
54
45
|
</script>
|
|
55
46
|
|
|
@@ -3,39 +3,46 @@ import { onClickOutside, useVModel } from "@vueuse/core";
|
|
|
3
3
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
4
4
|
import { computed, nextTick, ref, watchEffect } from "vue";
|
|
5
5
|
const props = defineProps({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
required: false,
|
|
9
|
+
default: false
|
|
10
|
+
},
|
|
11
|
+
dim: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
required: false,
|
|
14
|
+
default: true
|
|
15
|
+
},
|
|
16
|
+
autoClose: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: false,
|
|
19
|
+
default: true
|
|
20
|
+
}
|
|
9
21
|
});
|
|
10
22
|
const emit = defineEmits(["close", "update:modelValue"]);
|
|
11
23
|
const show = useVModel(props, "modelValue", emit, { passive: true });
|
|
12
24
|
const card = ref(null);
|
|
13
25
|
const shown = ref(false);
|
|
14
26
|
const { activate, deactivate } = useFocusTrap(computed(() => card.value || document.body), { immediate: false });
|
|
15
|
-
watchEffect(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (show.value && card.value)
|
|
20
|
-
nextTick(activate);
|
|
21
|
-
else
|
|
22
|
-
deactivate();
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
onClickOutside(card, () => {
|
|
26
|
-
if (props.modelValue && props.autoClose) {
|
|
27
|
-
show.value = false;
|
|
28
|
-
emit("close");
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
ignore: ["a", "button", "summary"]
|
|
27
|
+
watchEffect(() => {
|
|
28
|
+
if (!shown.value && show.value) shown.value = true;
|
|
29
|
+
if (show.value && card.value) nextTick(activate);
|
|
30
|
+
else deactivate();
|
|
32
31
|
});
|
|
32
|
+
onClickOutside(card, () => {
|
|
33
|
+
if (props.modelValue && props.autoClose) {
|
|
34
|
+
show.value = false;
|
|
35
|
+
emit("close");
|
|
36
|
+
}
|
|
37
|
+
}, { ignore: [
|
|
38
|
+
"a",
|
|
39
|
+
"button",
|
|
40
|
+
"summary"
|
|
41
|
+
] });
|
|
33
42
|
</script>
|
|
34
43
|
|
|
35
44
|
<script>
|
|
36
|
-
export default {
|
|
37
|
-
inheritAttrs: false
|
|
38
|
-
};
|
|
45
|
+
export default { inheritAttrs: false };
|
|
39
46
|
</script>
|
|
40
47
|
|
|
41
48
|
<template>
|
|
@@ -2,35 +2,53 @@
|
|
|
2
2
|
import { onClickOutside, useElementSize } from "@vueuse/core";
|
|
3
3
|
import { ref } from "vue";
|
|
4
4
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
required: false
|
|
8
|
+
},
|
|
9
|
+
top: {
|
|
10
|
+
type: null,
|
|
11
|
+
required: false
|
|
12
|
+
},
|
|
13
|
+
left: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
autoClose: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
transition: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false,
|
|
24
|
+
default: "right"
|
|
25
|
+
}
|
|
10
26
|
});
|
|
11
27
|
const emit = defineEmits(["close"]);
|
|
12
28
|
const el = ref();
|
|
13
|
-
const { height } = useElementSize(() => props.top,
|
|
14
|
-
const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left,
|
|
29
|
+
const { height } = useElementSize(() => props.top, undefined, { box: "border-box" });
|
|
30
|
+
const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left, undefined, { box: "border-box" }).width;
|
|
15
31
|
onClickOutside(el, () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
if (props.modelValue && props.autoClose) emit("close");
|
|
33
|
+
}, { ignore: [
|
|
34
|
+
"a",
|
|
35
|
+
"button",
|
|
36
|
+
"summary",
|
|
37
|
+
"[role=\"dialog\"]"
|
|
38
|
+
] });
|
|
21
39
|
const transitionType = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
right: {
|
|
41
|
+
"enter-from-class": "transform translate-x-1/1",
|
|
42
|
+
"leave-to-class": "transform translate-x-1/1"
|
|
43
|
+
},
|
|
44
|
+
top: {
|
|
45
|
+
"enter-from-class": "transform translate-y--1/1",
|
|
46
|
+
"leave-to-class": "transform translate-y--1/1"
|
|
47
|
+
},
|
|
48
|
+
bottom: {
|
|
49
|
+
"enter-from-class": "transform translate-y-1/1",
|
|
50
|
+
"leave-to-class": "transform translate-y-1/1"
|
|
51
|
+
}
|
|
34
52
|
};
|
|
35
53
|
</script>
|
|
36
54
|
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
import { onClickOutside, useVModel } from "@vueuse/core";
|
|
3
3
|
import { ref } from "vue";
|
|
4
4
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
required: false
|
|
8
|
+
},
|
|
9
|
+
direction: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false,
|
|
12
|
+
default: "start"
|
|
13
|
+
}
|
|
7
14
|
});
|
|
8
15
|
const emit = defineEmits([]);
|
|
9
16
|
const enabled = useVModel(props, "modelValue", emit, { passive: true });
|
|
10
17
|
const el = ref();
|
|
11
18
|
onClickOutside(el, () => {
|
|
12
|
-
|
|
19
|
+
enabled.value = false;
|
|
13
20
|
});
|
|
14
21
|
</script>
|
|
15
22
|
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { ref, watchEffect } from "vue";
|
|
3
|
+
import { getIconifySvg } from "../composables/iconify";
|
|
4
|
+
const props = defineProps({ icon: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: false
|
|
7
|
+
} });
|
|
8
|
+
const svg = ref();
|
|
9
|
+
watchEffect(async () => {
|
|
10
|
+
svg.value = props.icon ? await getIconifySvg(props.icon) : undefined;
|
|
4
11
|
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
<template>
|
|
8
|
-
<div
|
|
15
|
+
<div
|
|
16
|
+
v-if="svg"
|
|
17
|
+
class="n-icon"
|
|
18
|
+
inline-block align-middle
|
|
19
|
+
v-html="svg"
|
|
20
|
+
/>
|
|
21
|
+
<div v-else class="n-icon" :class="icon" />
|
|
9
22
|
</template>
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
to: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: false
|
|
7
|
+
},
|
|
8
|
+
href: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: false
|
|
11
|
+
},
|
|
12
|
+
target: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
underline: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: false
|
|
19
|
+
}
|
|
8
20
|
});
|
|
9
21
|
const link = computed(() => props.href || props.to);
|
|
10
22
|
</script>
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
// This components requires to run in DevTools to render correctly
|
|
2
3
|
import { devToolsClient } from "../runtime/client";
|
|
3
4
|
defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
markdown: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
tag: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false
|
|
12
|
+
}
|
|
6
13
|
});
|
|
7
14
|
</script>
|
|
8
15
|
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
defineProps({
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
search: {
|
|
4
|
+
type: String,
|
|
5
|
+
required: false
|
|
6
|
+
},
|
|
7
|
+
noPadding: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
required: false
|
|
10
|
+
}
|
|
5
11
|
});
|
|
6
12
|
const emit = defineEmits(["update:search"]);
|
|
7
13
|
function update(event) {
|
|
8
|
-
|
|
14
|
+
emit("update:search", event.target.value);
|
|
9
15
|
}
|
|
10
16
|
</script>
|
|
11
17
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated The bespoke Nuxt DevTools toast has been retired. Notifications
|
|
4
|
+
* now flow through the devframe Messages system (Vite DevTools' built-in
|
|
5
|
+
* Messages dock + toast overlay). Use `devtoolsUiShowNotification(...)`, which
|
|
6
|
+
* is re-pointed onto that system — this component is a no-op shim kept only so
|
|
7
|
+
* existing `<NNotification />` mounts don't break, and renders nothing.
|
|
8
|
+
*/
|
|
3
9
|
</script>
|
|
4
10
|
|
|
5
11
|
<template>
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: false,
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: false,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
name: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: false
|
|
21
|
+
}
|
|
8
22
|
});
|
|
9
23
|
const emit = defineEmits([]);
|
|
10
24
|
const model = useVModel(props, "modelValue", emit, { passive: true });
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
icon: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: false
|
|
7
|
+
},
|
|
8
|
+
text: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: false
|
|
11
|
+
},
|
|
12
|
+
description: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
containerClass: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
headerClass: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
collapse: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: false,
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
open: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: false,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
padding: {
|
|
36
|
+
type: [Boolean, String],
|
|
37
|
+
required: false,
|
|
38
|
+
default: true
|
|
39
|
+
}
|
|
12
40
|
});
|
|
13
|
-
const open = useVModel(props, "open",
|
|
41
|
+
const open = useVModel(props, "open", undefined, { passive: true });
|
|
14
42
|
function onToggle(e) {
|
|
15
|
-
|
|
43
|
+
open.value = e.target.open;
|
|
16
44
|
}
|
|
17
45
|
</script>
|
|
18
46
|
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: null,
|
|
6
|
+
required: false,
|
|
7
|
+
default: undefined
|
|
8
|
+
},
|
|
9
|
+
placeholder: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
icon: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false,
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
8
24
|
});
|
|
9
25
|
const emit = defineEmits([]);
|
|
10
26
|
const input = useVModel(props, "modelValue", emit, { passive: true });
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: null,
|
|
6
|
+
required: false,
|
|
7
|
+
default: undefined
|
|
8
|
+
},
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: false,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
options: {
|
|
15
|
+
type: Array,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
7
18
|
});
|
|
8
19
|
const emit = defineEmits([]);
|
|
9
20
|
const input = useVModel(props, "modelValue", emit, { passive: true });
|
|
@@ -4,20 +4,36 @@ import { Pane, Splitpanes } from "splitpanes";
|
|
|
4
4
|
import { computed, ref } from "vue";
|
|
5
5
|
import "splitpanes/dist/splitpanes.css";
|
|
6
6
|
const props = defineProps({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
storageKey: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: false
|
|
10
|
+
},
|
|
11
|
+
stateKey: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false,
|
|
14
|
+
default: "nuxt-devtools-panels-state"
|
|
15
|
+
},
|
|
16
|
+
leftSize: {
|
|
17
|
+
type: Number,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
minSize: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
horizontal: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
}
|
|
12
28
|
});
|
|
13
29
|
const state = useLocalStorage(props.stateKey, {}, { listenToStorageChanges: false });
|
|
14
30
|
const DEFAULT = 30;
|
|
15
31
|
const key = props.storageKey;
|
|
16
32
|
const size = key ? computed({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
get: () => state.value[key] || props.leftSize || DEFAULT,
|
|
34
|
+
set: (v) => {
|
|
35
|
+
state.value[key] = v;
|
|
36
|
+
}
|
|
21
37
|
}) : ref(props.leftSize || DEFAULT);
|
|
22
38
|
</script>
|
|
23
39
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
defineProps({
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
defineProps({ disabled: {
|
|
3
|
+
type: Boolean,
|
|
4
|
+
required: false,
|
|
5
|
+
default: false
|
|
6
|
+
} });
|
|
5
7
|
const checked = defineModel("modelValue", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false
|
|
8
10
|
});
|
|
9
11
|
</script>
|
|
10
12
|
|
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useVModel } from "@vueuse/core";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: [String, Number],
|
|
6
|
+
required: false,
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
icon: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false
|
|
12
|
+
},
|
|
13
|
+
placeholder: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
autofocus: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
autocomplete: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
readonly: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: false
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
default: "text"
|
|
37
|
+
}
|
|
12
38
|
});
|
|
13
|
-
const emit = defineEmits([
|
|
39
|
+
const emit = defineEmits([
|
|
40
|
+
"keydown",
|
|
41
|
+
"keyup",
|
|
42
|
+
"change"
|
|
43
|
+
]);
|
|
14
44
|
const input = useVModel(props, "modelValue", emit, { passive: true });
|
|
15
45
|
</script>
|
|
16
46
|
|
package/dist/components/NTip.vue
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a UnoCSS-style icon id (`carbon-tree-view-alt`, `i-logos-vue`,
|
|
3
|
+
* `carbon:settings`, ...) to inline, sanitized SVG markup, fetched from the
|
|
4
|
+
* Iconify API and cached in-memory. Returns `undefined` when the id doesn't
|
|
5
|
+
* parse as a known Iconify collection, or the fetch fails.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getIconifySvg(id: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { parseIconWithLoader } from "@unocss/preset-icons/browser";
|
|
2
|
+
import DOMPurify from "dompurify";
|
|
3
|
+
const cache = /* @__PURE__ */ new Map();
|
|
4
|
+
async function fetchIconifySvg(collection, icon) {
|
|
5
|
+
const url = `https://api.iconify.design/${collection}/${icon}.svg?color=currentColor&width=1.2em&height=1.2em`;
|
|
6
|
+
try {
|
|
7
|
+
const res = await fetch(url, { signal: AbortSignal.timeout(1e4) });
|
|
8
|
+
if (!res.ok)
|
|
9
|
+
return void 0;
|
|
10
|
+
return DOMPurify.sanitize(await res.text(), { USE_PROFILES: { svg: true } });
|
|
11
|
+
} catch {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function getIconifySvg(id) {
|
|
16
|
+
const cached = cache.get(id);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
const promise = parseIconWithLoader(id.replace(/^i-/, ""), fetchIconifySvg).then((result) => result?.svg).catch(() => void 0);
|
|
20
|
+
cache.set(id, promise);
|
|
21
|
+
promise.then((svg) => svg === void 0 && cache.delete(id));
|
|
22
|
+
return promise;
|
|
23
|
+
}
|
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/devtools-ui-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.18",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"deprecated": "This package is deprecated and no longer recommended for use. See https://devtools.nuxt.com/module/ui-kit for details.",
|
|
7
7
|
"homepage": "https://devtools.nuxt.com/module/ui-kit",
|
|
@@ -20,34 +20,35 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@nuxt/devtools": "4.0.0-alpha.
|
|
23
|
+
"@nuxt/devtools": "4.0.0-alpha.18",
|
|
24
24
|
"@nuxt/kit": "^4.0.0-0 || ^5.0.0-0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@iconify-json/carbon": "^1.2.26",
|
|
28
|
-
"@iconify-json/logos": "^1.2.
|
|
28
|
+
"@iconify-json/logos": "^1.2.14",
|
|
29
29
|
"@iconify-json/ri": "^1.2.10",
|
|
30
30
|
"@iconify-json/tabler": "^1.2.38",
|
|
31
|
-
"@nuxt/devtools-kit": "4.0.0-alpha.
|
|
32
|
-
"@unocss/core": "^66.
|
|
33
|
-
"@unocss/nuxt": "^66.
|
|
34
|
-
"@unocss/preset-attributify": "^66.
|
|
35
|
-
"@unocss/preset-icons": "^66.
|
|
36
|
-
"@unocss/preset-mini": "^66.
|
|
37
|
-
"@unocss/reset": "^66.
|
|
31
|
+
"@nuxt/devtools-kit": "4.0.0-alpha.18",
|
|
32
|
+
"@unocss/core": "^66.10.1",
|
|
33
|
+
"@unocss/nuxt": "^66.10.1",
|
|
34
|
+
"@unocss/preset-attributify": "^66.10.1",
|
|
35
|
+
"@unocss/preset-icons": "^66.10.1",
|
|
36
|
+
"@unocss/preset-mini": "^66.10.1",
|
|
37
|
+
"@unocss/reset": "^66.10.1",
|
|
38
38
|
"@vueuse/core": "^14.4.0",
|
|
39
39
|
"@vueuse/integrations": "^14.4.0",
|
|
40
40
|
"@vueuse/nuxt": "^14.4.0",
|
|
41
41
|
"defu": "^6.1.7",
|
|
42
|
+
"dompurify": "^3.2.4",
|
|
42
43
|
"focus-trap": "^8.2.2",
|
|
43
44
|
"splitpanes": "^4.1.2",
|
|
44
|
-
"unocss": "^66.
|
|
45
|
+
"unocss": "^66.10.1",
|
|
45
46
|
"v-lazy-show": "^0.3.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@nuxt/devtools": "4.0.0-alpha.
|
|
49
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-
|
|
50
|
-
"nuxt": "npm:nuxt-nightly@5.0.0-
|
|
49
|
+
"@nuxt/devtools": "4.0.0-alpha.18",
|
|
50
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-29806258.d070492f",
|
|
51
|
+
"nuxt": "npm:nuxt-nightly@5.0.0-29806258.d070492f",
|
|
51
52
|
"unbuild": "^3.6.1"
|
|
52
53
|
},
|
|
53
54
|
"publishConfig": {
|