@shwfed/nuxt 0.1.44 → 0.1.46
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/module.json
CHANGED
|
@@ -4,7 +4,7 @@ import { ref } from "vue";
|
|
|
4
4
|
import { CommandDialog, CommandInput, CommandList, CommandGroup, CommandEmpty, CommandItem, CommandSeparator } from "./ui/command";
|
|
5
5
|
import { TooltipProvider } from "./ui/tooltip";
|
|
6
6
|
import { Toaster } from "vue-sonner";
|
|
7
|
-
import { useMagicKeys, whenever } from "@vueuse/core";
|
|
7
|
+
import { useMagicKeys, useTimeoutFn, whenever } from "@vueuse/core";
|
|
8
8
|
import { useI18n } from "vue-i18n";
|
|
9
9
|
import { Icon } from "@iconify/vue";
|
|
10
10
|
import { Effect } from "effect";
|
|
@@ -24,6 +24,10 @@ useHead({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
const isCommandOpen = ref(false);
|
|
27
|
+
const isDropdownOpen = ref(false);
|
|
28
|
+
const { start: startDropdownCloseTimer, stop: stopDropdownCloseTimer } = useTimeoutFn(() => {
|
|
29
|
+
isDropdownOpen.value = false;
|
|
30
|
+
}, 150, { immediate: false });
|
|
27
31
|
const { meta_k } = useMagicKeys();
|
|
28
32
|
whenever(() => meta_k?.value, () => {
|
|
29
33
|
isCommandOpen.value = !isCommandOpen.value;
|
|
@@ -60,6 +64,7 @@ whenever(() => meta_k?.value, () => {
|
|
|
60
64
|
v-for="child in group.children"
|
|
61
65
|
:key="child.id"
|
|
62
66
|
:value="child.id"
|
|
67
|
+
:disabled="child.disabled"
|
|
63
68
|
@select="
|
|
64
69
|
child.effect.pipe(Effect.scoped).pipe(Effect.tap(() => {
|
|
65
70
|
isCommandOpen = false;
|
|
@@ -145,13 +150,24 @@ whenever(() => meta_k?.value, () => {
|
|
|
145
150
|
<slot name="menu" />
|
|
146
151
|
<span class="flex-1" />
|
|
147
152
|
<DropdownMenu
|
|
153
|
+
v-model:open="isDropdownOpen"
|
|
148
154
|
:modal="false"
|
|
155
|
+
@update:open="stopDropdownCloseTimer();
|
|
156
|
+
isDropdownOpen = $event"
|
|
149
157
|
>
|
|
150
158
|
<DropdownMenuTrigger as-child>
|
|
151
159
|
<button
|
|
152
160
|
ref="dropdown-trigger"
|
|
153
161
|
type="button"
|
|
154
162
|
class="text-white text-sm cursor-pointer appearance-none outline-none pl-4 py-2"
|
|
163
|
+
@pointerenter="stopDropdownCloseTimer();
|
|
164
|
+
isDropdownOpen = true"
|
|
165
|
+
@pointerleave="stopDropdownCloseTimer();
|
|
166
|
+
startDropdownCloseTimer()"
|
|
167
|
+
@click.prevent="if (!isDropdownOpen) {
|
|
168
|
+
stopDropdownCloseTimer();
|
|
169
|
+
isDropdownOpen = true;
|
|
170
|
+
}"
|
|
155
171
|
>
|
|
156
172
|
<slot name="dropdown-trigger" />
|
|
157
173
|
</button>
|
|
@@ -159,6 +175,9 @@ whenever(() => meta_k?.value, () => {
|
|
|
159
175
|
<DropdownMenuContent
|
|
160
176
|
class="min-w-56"
|
|
161
177
|
align="end"
|
|
178
|
+
@pointerenter="stopDropdownCloseTimer()"
|
|
179
|
+
@pointerleave="stopDropdownCloseTimer();
|
|
180
|
+
startDropdownCloseTimer()"
|
|
162
181
|
>
|
|
163
182
|
<template
|
|
164
183
|
v-for="group in commands?.filter((group2) => group2.position.includes('dropdown') && group2.children.length > 0)"
|
|
@@ -171,6 +190,7 @@ whenever(() => meta_k?.value, () => {
|
|
|
171
190
|
<DropdownMenuItem
|
|
172
191
|
v-for="item in group.children"
|
|
173
192
|
:key="item.id"
|
|
193
|
+
:disabled="item.disabled"
|
|
174
194
|
@select="item.effect.pipe(Effect.scoped).pipe(Effect.tap(() => {
|
|
175
195
|
isCommandOpen = false;
|
|
176
196
|
})).pipe(Effect.runPromise)"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shwfed/nuxt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dev": "npm run dev:prepare && nuxt dev playground",
|
|
30
30
|
"dev:build": "nuxt build playground",
|
|
31
31
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
32
|
-
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
32
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags && git pull --tags --force origin main",
|
|
33
33
|
"lint": "eslint .",
|
|
34
34
|
"postinstall": "husky",
|
|
35
35
|
"test": "vitest run",
|