@anweb/nuxt-ancore 1.16.1 → 1.16.2

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": "AnCore",
3
3
  "configKey": "ancore",
4
- "version": "1.16.1",
4
+ "version": "1.16.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,12 +1,34 @@
1
1
  <script setup>
2
- import { useScrollLock } from "@vueuse/core";
2
+ import { watch } from "vue";
3
3
  import { useAnDialogs } from "#imports";
4
4
  import { AnDialogsItem } from "#components";
5
5
  const Dialogs = useAnDialogs();
6
- const isLocked = useScrollLock(import.meta.client ? window : null);
7
- const onAnimation = () => {
8
- isLocked.value = !!Dialogs.items.length;
6
+ let scrollY = 0;
7
+ const lockScroll = () => {
8
+ scrollY = window.scrollY;
9
+ document.documentElement.style.overflowY = "scroll";
10
+ document.body.style.position = "fixed";
11
+ document.body.style.top = `-${scrollY}px`;
12
+ document.body.style.left = "0";
13
+ document.body.style.width = "100%";
9
14
  };
15
+ const unlockScroll = () => {
16
+ document.body.style.position = "";
17
+ document.body.style.top = "";
18
+ document.body.style.left = "";
19
+ document.body.style.width = "";
20
+ document.documentElement.style.overflowY = "";
21
+ window.scrollTo(0, scrollY);
22
+ };
23
+ if (import.meta.client) {
24
+ watch(
25
+ () => Dialogs.items.length,
26
+ (count, prev) => {
27
+ if (count > 0 && (!prev || prev === 0)) lockScroll();
28
+ else if (count === 0 && prev && prev > 0) unlockScroll();
29
+ }
30
+ );
31
+ }
10
32
  </script>
11
33
 
12
34
  <template>
@@ -15,9 +37,6 @@ const onAnimation = () => {
15
37
  name="an-dialogs"
16
38
  tag="div"
17
39
  aria-live="polite"
18
-
19
- @before-enter="onAnimation"
20
- @after-leave="onAnimation"
21
40
  >
22
41
  <AnDialogsItem
23
42
  v-for="dialog of Dialogs.items"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-ancore",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
4
4
  "description": "AnCore Nuxt module",
5
5
  "repository": "https://github.com/ANLTD/ancore",
6
6
  "license": "MIT",
@@ -27,25 +27,26 @@
27
27
  "dev": "npm run dev:prepare && nuxi dev playground",
28
28
  "dev:build": "nuxi build playground",
29
29
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
30
- "release:patch": "npm run prepack && changelogen --patch --release && npm publish --access public && git push --follow-tags",
31
- "release:minor": "npm run prepack && changelogen --minor --release && npm publish --access public && git push --follow-tags",
32
- "release:major": "npm run prepack && changelogen --major --release && npm publish --access public && git push --follow-tags"
30
+ "release:patch": "npm run prepack && changelogen --patch --release && npm login && npm publish --access public && git push --follow-tags",
31
+ "release:minor": "npm run prepack && changelogen --minor --release && npm login && npm publish --access public && git push --follow-tags",
32
+ "release:major": "npm run prepack && changelogen --major --release && npm login && npm publish --access public && git push --follow-tags",
33
+ "update": "npx -y npm-check-updates -u"
33
34
  },
34
35
  "dependencies": {
35
- "@vueuse/core": "^14.2.0",
36
- "@vueuse/integrations": "^14.2.0",
36
+ "@vueuse/core": "^14.2.1",
37
+ "@vueuse/integrations": "^14.2.1",
37
38
  "async-validator": "^4.2.5",
38
- "i18next": "^25.8.0",
39
+ "i18next": "^25.8.10",
39
40
  "uuid": "^13.0.0"
40
41
  },
41
42
  "devDependencies": {
42
- "@nuxt/devtools": "^3.1.1",
43
- "@nuxt/kit": "^4.3.0",
43
+ "@nuxt/devtools": "^3.2.1",
44
+ "@nuxt/kit": "^4.3.1",
44
45
  "@nuxt/module-builder": "^1.0.2",
45
- "@nuxt/schema": "^4.3.0",
46
+ "@nuxt/schema": "^4.3.1",
46
47
  "@types/node": "latest",
47
48
  "changelogen": "^0.6.2",
48
- "nuxt": "^4.3.0",
49
+ "nuxt": "^4.3.1",
49
50
  "typescript": "~5.9.3"
50
51
  }
51
52
  }