@shwfed/nuxt 0.1.45 → 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.45",
4
+ "version": "0.1.46",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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;
@@ -146,13 +150,24 @@ whenever(() => meta_k?.value, () => {
146
150
  <slot name="menu" />
147
151
  <span class="flex-1" />
148
152
  <DropdownMenu
153
+ v-model:open="isDropdownOpen"
149
154
  :modal="false"
155
+ @update:open="stopDropdownCloseTimer();
156
+ isDropdownOpen = $event"
150
157
  >
151
158
  <DropdownMenuTrigger as-child>
152
159
  <button
153
160
  ref="dropdown-trigger"
154
161
  type="button"
155
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
+ }"
156
171
  >
157
172
  <slot name="dropdown-trigger" />
158
173
  </button>
@@ -160,6 +175,9 @@ whenever(() => meta_k?.value, () => {
160
175
  <DropdownMenuContent
161
176
  class="min-w-56"
162
177
  align="end"
178
+ @pointerenter="stopDropdownCloseTimer()"
179
+ @pointerleave="stopDropdownCloseTimer();
180
+ startDropdownCloseTimer()"
163
181
  >
164
182
  <template
165
183
  v-for="group in commands?.filter((group2) => group2.position.includes('dropdown') && group2.children.length > 0)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.1.45",
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",