kmcom-nuxt-layers 2.2.4 → 2.2.5

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.
@@ -1,24 +1,25 @@
1
1
  export default defineNuxtPlugin({
2
2
  name: 'routing:scroll-routing',
3
3
  setup() {
4
- const { config } = useRoutingConfig()
5
- if (!config.scrollRouting.enabled) return
4
+ const { config } = useRoutingConfig()
5
+ if (!config.scrollRouting.enabled) return
6
6
 
7
- const router = useRouter()
8
- const observer = new IntersectionObserver(
9
- (entries) => {
10
- const visible = entries.find((e) => e.isIntersecting)
11
- if (!visible) return
12
- const id = visible.target.getAttribute('data-section')
13
- if (!id) return
14
- const method = config.scrollRouting.mode === 'push' ? 'push' : 'replace'
15
- router[method]({ hash: `#${id}` })
16
- },
17
- { threshold: 0.5 }
18
- )
7
+ const router = useRouter()
8
+ // fallow-ignore-next-line code-duplication
9
+ const observer = new IntersectionObserver(
10
+ (entries) => {
11
+ const visible = entries.find((e) => e.isIntersecting)
12
+ if (!visible) return
13
+ const id = visible.target.getAttribute('data-section')
14
+ if (!id) return
15
+ const method = config.scrollRouting.mode === 'push' ? 'push' : 'replace'
16
+ router[method]({ hash: `#${id}` })
17
+ },
18
+ { threshold: 0.5 }
19
+ )
19
20
 
20
- onNuxtReady(() => {
21
- document.querySelectorAll('[data-section]').forEach((el) => observer.observe(el))
22
- })
21
+ onNuxtReady(() => {
22
+ document.querySelectorAll('[data-section]').forEach((el) => observer.observe(el))
23
+ })
23
24
  },
24
25
  })
@@ -40,7 +40,7 @@
40
40
  :loading
41
41
  :fetchpriority
42
42
  :decoding
43
- :provider
43
+ :provider="(provider as any)"
44
44
  :preset
45
45
  :densities
46
46
  :class="wrapperClass"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "2.2.4",
4
+ "version": "2.2.5",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "exports": {
7
7
  "./layers/core": "./layers/core/nuxt.config.ts",