@ctx-core/scroll 12.0.69 → 12.0.74
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/.swcrc +1 -1
- package/CHANGELOG.md +48 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sticky_scroll_active$_b.js +1 -1
- package/dist/sticky_scroll_active$_b.js.map +1 -1
- package/dist/ui/Sticky_Scroll.svelte +26 -40
- package/dist/ui/index.js +2 -2
- package/dist/ui/index.js.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +1 -1
- package/src/sticky_scroll_active$_b.ts +1 -1
- package/src/ui/Sticky_Scroll.svelte +26 -40
- package/src/ui/index.ts +1 -2
package/.swcrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @ctx-core/scroll
|
|
2
2
|
|
|
3
|
+
## 12.0.74
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @swc/cli: ^0.1.51 -> ^0.1.52
|
|
8
|
+
- @swc/core: ^1.2.111 -> ^1.2.113
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- @ctx-core/object@21.0.26
|
|
12
|
+
- @ctx-core/store@27.0.40
|
|
13
|
+
|
|
14
|
+
## 12.0.73
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- svelte: 3.44.1 -> 3.44.2
|
|
19
|
+
- @swc/core: ^1.2.110 -> ^1.2.111
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @ctx-core/store@27.0.39
|
|
23
|
+
- @ctx-core/object@21.0.25
|
|
24
|
+
|
|
25
|
+
## 12.0.72
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- typescript: ^4.4.4 -> ^4.5.2
|
|
30
|
+
- @swc/core: ^1.2.108 -> ^1.2.110
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @ctx-core/object@21.0.24
|
|
34
|
+
- @ctx-core/store@27.0.38
|
|
35
|
+
|
|
36
|
+
## 12.0.71
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Sticky_Scroll: lang=ts
|
|
41
|
+
|
|
42
|
+
## 12.0.70
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- @swc/core: ^1.2.107 -> ^1.2.108
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @ctx-core/object@21.0.23
|
|
49
|
+
- @ctx-core/store@27.0.37
|
|
50
|
+
|
|
3
51
|
## 12.0.69
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './scroll_Ctx.js'\nexport * from './scroll_ctx_I.generated.js'\nexport * from './is_active_.js'\nexport * from './is_visible_.js'\nexport * from './out_is_active_.js'\nexport * from './out_is_visible_.js'\nexport * from './sticky_scroll_active$_b.js'\nexport * from './ui'\n"],"names":[],"mappings":"cAAc,CAAiB;cACjB,CAA6B;cAC7B,CAAiB;cACjB,CAAkB;cAClB,CAAqB;cACrB,CAAsB;cACtB,CAA8B;cAC9B,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './scroll_Ctx.js'\nexport * from './scroll_ctx_I.generated.js'\nexport * from './is_active_.js'\nexport * from './is_visible_.js'\nexport * from './out_is_active_.js'\nexport * from './out_is_visible_.js'\nexport * from './sticky_scroll_active$_b.js'\nexport * from './ui/index.js'\n"],"names":[],"mappings":"cAAc,CAAiB;cACjB,CAA6B;cAC7B,CAAiB;cACjB,CAAkB;cAClB,CAAqB;cACrB,CAAsB;cACtB,CAA8B;cAC9B,CAAe"}
|
|
@@ -23,7 +23,7 @@ export const sticky_scroll_active$_b = b_(key1, ()=>{
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function sticky_scroll_active_key_active_(key) {
|
|
26
|
-
const sticky_scroll_active = sticky_scroll_active
|
|
26
|
+
const sticky_scroll_active = sticky_scroll_active$.$;
|
|
27
27
|
const active = sticky_scroll_active ? sticky_scroll_active[key] : false;
|
|
28
28
|
return active;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sticky_scroll_active$_b.ts"],"sourcesContent":["import { assign, b_, B } from '@ctx-core/object'\nimport { writable$, Writable$ } from '@ctx-core/store'\nimport type { scroll_Ctx } from './scroll_Ctx'\nconst key = 'sticky_scroll_active$'\nexport const sticky_scroll_active$_b:B<scroll_Ctx, typeof key> = b_(key, ()=>{\n\tconst sticky_scroll_active$ = writable$<sticky_scroll_active_T>({})\n\treturn assign(sticky_scroll_active$, {\n\t\tadd_sticky_scroll_active,\n\t\tremove_sticky_scroll_active,\n\t\tsticky_scroll_active_key_active_,\n\t\tsticky_scroll_active_key_match_,\n\t}) as sticky_scroll_active$_T\n\tfunction add_sticky_scroll_active(key:string) {\n\t\tsticky_scroll_active$.update(\n\t\t\tscroll_sticky_active=>{\n\t\t\t\tscroll_sticky_active[key] = true\n\t\t\t\treturn scroll_sticky_active\n\t\t\t})\n\t}\n\tfunction remove_sticky_scroll_active(key:string) {\n\t\tsticky_scroll_active$.update(\n\t\t\tscroll_sticky_active=>{\n\t\t\t\tscroll_sticky_active[key] = false\n\t\t\t\treturn scroll_sticky_active\n\t\t\t})\n\t}\n\tfunction sticky_scroll_active_key_active_(key:string) {\n\t\tconst sticky_scroll_active = sticky_scroll_active
|
|
1
|
+
{"version":3,"sources":["../src/sticky_scroll_active$_b.ts"],"sourcesContent":["import { assign, b_, B } from '@ctx-core/object'\nimport { writable$, Writable$ } from '@ctx-core/store'\nimport type { scroll_Ctx } from './scroll_Ctx'\nconst key = 'sticky_scroll_active$'\nexport const sticky_scroll_active$_b:B<scroll_Ctx, typeof key> = b_(key, ()=>{\n\tconst sticky_scroll_active$ = writable$<sticky_scroll_active_T>({})\n\treturn assign(sticky_scroll_active$, {\n\t\tadd_sticky_scroll_active,\n\t\tremove_sticky_scroll_active,\n\t\tsticky_scroll_active_key_active_,\n\t\tsticky_scroll_active_key_match_,\n\t}) as sticky_scroll_active$_T\n\tfunction add_sticky_scroll_active(key:string) {\n\t\tsticky_scroll_active$.update(\n\t\t\tscroll_sticky_active=>{\n\t\t\t\tscroll_sticky_active[key] = true\n\t\t\t\treturn scroll_sticky_active\n\t\t\t})\n\t}\n\tfunction remove_sticky_scroll_active(key:string) {\n\t\tsticky_scroll_active$.update(\n\t\t\tscroll_sticky_active=>{\n\t\t\t\tscroll_sticky_active[key] = false\n\t\t\t\treturn scroll_sticky_active\n\t\t\t})\n\t}\n\tfunction sticky_scroll_active_key_active_(key:string) {\n\t\tconst sticky_scroll_active = sticky_scroll_active$.$\n\t\tconst active =\n\t\t\tsticky_scroll_active\n\t\t\t? sticky_scroll_active[key]\n\t\t\t: false\n\t\treturn active\n\t}\n\tfunction sticky_scroll_active_key_match_(key:string, active:boolean) {\n\t\treturn !!(active) == !!(sticky_scroll_active_key_active_(key))\n\t}\n})\nexport interface sticky_scroll_active_T extends Record<string, boolean> {}\nexport interface sticky_scroll_active$_T extends Writable$<sticky_scroll_active_T> {\n\tadd_sticky_scroll_active:(key:string)=>void\n\tremove_sticky_scroll_active:(key:string)=>void\n\tsticky_scroll_active_key_active_:(key:string)=>void\n\tsticky_scroll_active_key_match_:(key:string, active:any)=>void\n}\nexport {\n\tsticky_scroll_active$_b as b__active__Sticky__Scroll,\n}\n"],"names":["assign","b_","writable$","key","sticky_scroll_active$_b","sticky_scroll_active$","add_sticky_scroll_active","remove_sticky_scroll_active","sticky_scroll_active_key_active_","sticky_scroll_active_key_match_","update","scroll_sticky_active","sticky_scroll_active","$","active","b__active__Sticky__Scroll"],"mappings":"AAAA,MAAM,GAAGA,MAAM,EAAEC,EAAE,QAAW,CAAkB;AAChD,MAAM,GAAGC,SAAS,QAAmB,CAAiB;AAEtD,KAAK,CAACC,IAAG,GAAG,CAAuB;AACnC,MAAM,CAAC,KAAK,CAACC,uBAAuB,GAA6BH,EAAE,CAACE,IAAG,MAAM,CAAC;IAC7E,KAAK,CAACE,qBAAqB,GAAGH,SAAS,CAAyB,CAAC;IAAA,CAAC;IAClE,MAAM,CAACF,MAAM,CAACK,qBAAqB,EAAE,CAAC;QACrCC,wBAAwB;QACxBC,2BAA2B;QAC3BC,gCAAgC;QAChCC,+BAA+B;IAChC,CAAC;aACQH,wBAAwB,CAACH,GAAU,EAAE,CAAC;QAC9CE,qBAAqB,CAACK,MAAM,EAC3BC,oBAAoB,GAAE,CAAC;YACtBA,oBAAoB,CAACR,GAAG,IAAI,IAAI;YAChC,MAAM,CAACQ,oBAAoB;QAC5B,CAAC;IACH,CAAC;aACQJ,2BAA2B,CAACJ,GAAU,EAAE,CAAC;QACjDE,qBAAqB,CAACK,MAAM,EAC3BC,oBAAoB,GAAE,CAAC;YACtBA,oBAAoB,CAACR,GAAG,IAAI,KAAK;YACjC,MAAM,CAACQ,oBAAoB;QAC5B,CAAC;IACH,CAAC;aACQH,gCAAgC,CAACL,GAAU,EAAE,CAAC;QACtD,KAAK,CAACS,oBAAoB,GAAGP,qBAAqB,CAACQ,CAAC;QACpD,KAAK,CAACC,MAAM,GACXF,oBAAoB,GAClBA,oBAAoB,CAACT,GAAG,IACxB,KAAK;QACR,MAAM,CAACW,MAAM;IACd,CAAC;aACQL,+BAA+B,CAACN,GAAU,EAAEW,MAAc,EAAE,CAAC;QACrE,MAAM,GAAIA,MAAM,MAAQN,gCAAgC,CAACL,GAAG;IAC7D,CAAC;AACF,CAAC;AAQD,MAAM,GACLC,uBAAuB,IAAIW,yBAAyB"}
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
|
3
|
-
import { out_is_active_ } from '../out_is_active_'
|
|
4
|
-
import { out_is_visible_ } from '../out_is_visible_'
|
|
3
|
+
import { out_is_active_ } from '../out_is_active_.js'
|
|
4
|
+
import { out_is_visible_ } from '../out_is_visible_.js'
|
|
5
5
|
const dispatch = createEventDispatcher()
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onMount(() => {
|
|
12
|
-
reset({})
|
|
6
|
+
export let terminal:HTMLElement|null = null
|
|
7
|
+
let getBoundingClientRect = default_getBoundingClientRect, root:HTMLDivElement|null = null,
|
|
8
|
+
active:boolean, visible:boolean
|
|
9
|
+
onMount(()=>{
|
|
10
|
+
reset()
|
|
13
11
|
if (terminal) {
|
|
14
|
-
|
|
15
|
-
terminal.addEventListener('scroll', reset)
|
|
16
|
-
} else if (terminal.on) {
|
|
17
|
-
terminal.on('scroll', reset)
|
|
18
|
-
}
|
|
12
|
+
terminal.addEventListener('scroll', reset)
|
|
19
13
|
}
|
|
20
14
|
})
|
|
21
|
-
onDestroy(()
|
|
15
|
+
onDestroy(()=>{
|
|
22
16
|
if (terminal) {
|
|
23
|
-
|
|
24
|
-
terminal.removeEventListener('scroll', reset)
|
|
25
|
-
} else if (terminal.off) {
|
|
26
|
-
terminal.off('scroll', reset)
|
|
27
|
-
}
|
|
17
|
+
terminal.removeEventListener('scroll', reset)
|
|
28
18
|
}
|
|
29
19
|
if (contains_visible()) {
|
|
30
20
|
remove_visible()
|
|
@@ -33,10 +23,10 @@ onDestroy(() => {
|
|
|
33
23
|
remove_active()
|
|
34
24
|
}
|
|
35
25
|
})
|
|
36
|
-
function reset(
|
|
37
|
-
const { top, bottom } = getBoundingClientRect(
|
|
26
|
+
function reset() {
|
|
27
|
+
const { top, bottom } = getBoundingClientRect()
|
|
38
28
|
const { innerHeight } = window
|
|
39
|
-
const out_is_active= out_is_active_(top, bottom)
|
|
29
|
+
const out_is_active = out_is_active_(top, bottom)
|
|
40
30
|
const out_is_visible = out_is_visible_(top, bottom, innerHeight)
|
|
41
31
|
if (out_is_visible) {
|
|
42
32
|
if (!visible) {
|
|
@@ -59,30 +49,30 @@ function reset(event) {
|
|
|
59
49
|
}
|
|
60
50
|
function add_active() {
|
|
61
51
|
active = true
|
|
62
|
-
dispatch('add_active',
|
|
52
|
+
dispatch('add_active', event_())
|
|
63
53
|
}
|
|
64
54
|
function remove_active() {
|
|
65
55
|
active = false
|
|
66
|
-
dispatch('remove_active',
|
|
56
|
+
dispatch('remove_active', event_())
|
|
67
57
|
}
|
|
68
58
|
function add_visible() {
|
|
69
59
|
visible = true
|
|
70
|
-
dispatch('add_visible',
|
|
60
|
+
dispatch('add_visible', event_())
|
|
71
61
|
}
|
|
72
62
|
function remove_visible() {
|
|
73
63
|
visible = false
|
|
74
|
-
dispatch('remove_visible',
|
|
64
|
+
dispatch('remove_visible', event_())
|
|
75
65
|
}
|
|
76
|
-
function default_getBoundingClientRect() {
|
|
77
|
-
return root
|
|
66
|
+
function default_getBoundingClientRect():DOMRect {
|
|
67
|
+
return root!.getBoundingClientRect()
|
|
78
68
|
}
|
|
79
69
|
function contains_visible() {
|
|
80
|
-
return root
|
|
70
|
+
return root!.classList.contains('visible')
|
|
81
71
|
}
|
|
82
72
|
function contains_active() {
|
|
83
|
-
return root
|
|
73
|
+
return root!.classList.contains('active')
|
|
84
74
|
}
|
|
85
|
-
function
|
|
75
|
+
function event_() {
|
|
86
76
|
return {
|
|
87
77
|
root,
|
|
88
78
|
target: root,
|
|
@@ -92,14 +82,10 @@ function _event() {
|
|
|
92
82
|
</script>
|
|
93
83
|
|
|
94
84
|
<svelte:window
|
|
95
|
-
on:scroll=
|
|
96
|
-
on:resize=
|
|
85
|
+
on:scroll={reset}
|
|
86
|
+
on:resize={reset}
|
|
97
87
|
/>
|
|
98
88
|
|
|
99
|
-
<div
|
|
100
|
-
bind:this="{root}"
|
|
101
|
-
class="Sticky_Scroll {$$props.class||''}"
|
|
102
|
-
class:active="{active}"
|
|
103
|
-
>
|
|
89
|
+
<div bind:this={root} class="Sticky_Scroll {$$props.class||''}" class:active>
|
|
104
90
|
<slot></slot>
|
|
105
91
|
</div>
|
package/dist/ui/index.js
CHANGED
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["import 'svelte'\
|
|
1
|
+
{"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["import 'svelte'\nexport * as Sticky_Scroll from './Sticky_Scroll.svelte'\n"],"names":["Sticky_Scroll"],"mappings":"AAAA,MAAM,CAAC,CAAQ;YACHA,cAAa,MAAM,CAAwB;SAA3CA,cAAa,IAAbA,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/scroll",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.74",
|
|
4
4
|
"description": "ctx-core scroll",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctx-core/object": "^21.0.
|
|
32
|
-
"@ctx-core/store": "^27.0.
|
|
33
|
-
"svelte": "3.44.
|
|
31
|
+
"@ctx-core/object": "^21.0.26",
|
|
32
|
+
"@ctx-core/store": "^27.0.40",
|
|
33
|
+
"svelte": "3.44.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@ctx-core/ctx-core-package-tools": "^8.0.
|
|
37
|
-
"@ctx-core/dev-tools": "^7.2.
|
|
38
|
-
"@swc/cli": "^0.1.
|
|
39
|
-
"@swc/core": "^1.2.
|
|
40
|
-
"typescript": "
|
|
36
|
+
"@ctx-core/ctx-core-package-tools": "^8.0.80",
|
|
37
|
+
"@ctx-core/dev-tools": "^7.2.4",
|
|
38
|
+
"@swc/cli": "^0.1.52",
|
|
39
|
+
"@swc/core": "^1.2.113",
|
|
40
|
+
"typescript": "next"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public",
|
package/src/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ export const sticky_scroll_active$_b:B<scroll_Ctx, typeof key> = b_(key, ()=>{
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
function sticky_scroll_active_key_active_(key:string) {
|
|
28
|
-
const sticky_scroll_active = sticky_scroll_active
|
|
28
|
+
const sticky_scroll_active = sticky_scroll_active$.$
|
|
29
29
|
const active =
|
|
30
30
|
sticky_scroll_active
|
|
31
31
|
? sticky_scroll_active[key]
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
|
3
|
-
import { out_is_active_ } from '../out_is_active_'
|
|
4
|
-
import { out_is_visible_ } from '../out_is_visible_'
|
|
3
|
+
import { out_is_active_ } from '../out_is_active_.js'
|
|
4
|
+
import { out_is_visible_ } from '../out_is_visible_.js'
|
|
5
5
|
const dispatch = createEventDispatcher()
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onMount(() => {
|
|
12
|
-
reset({})
|
|
6
|
+
export let terminal:HTMLElement|null = null
|
|
7
|
+
let getBoundingClientRect = default_getBoundingClientRect, root:HTMLDivElement|null = null,
|
|
8
|
+
active:boolean, visible:boolean
|
|
9
|
+
onMount(()=>{
|
|
10
|
+
reset()
|
|
13
11
|
if (terminal) {
|
|
14
|
-
|
|
15
|
-
terminal.addEventListener('scroll', reset)
|
|
16
|
-
} else if (terminal.on) {
|
|
17
|
-
terminal.on('scroll', reset)
|
|
18
|
-
}
|
|
12
|
+
terminal.addEventListener('scroll', reset)
|
|
19
13
|
}
|
|
20
14
|
})
|
|
21
|
-
onDestroy(()
|
|
15
|
+
onDestroy(()=>{
|
|
22
16
|
if (terminal) {
|
|
23
|
-
|
|
24
|
-
terminal.removeEventListener('scroll', reset)
|
|
25
|
-
} else if (terminal.off) {
|
|
26
|
-
terminal.off('scroll', reset)
|
|
27
|
-
}
|
|
17
|
+
terminal.removeEventListener('scroll', reset)
|
|
28
18
|
}
|
|
29
19
|
if (contains_visible()) {
|
|
30
20
|
remove_visible()
|
|
@@ -33,10 +23,10 @@ onDestroy(() => {
|
|
|
33
23
|
remove_active()
|
|
34
24
|
}
|
|
35
25
|
})
|
|
36
|
-
function reset(
|
|
37
|
-
const { top, bottom } = getBoundingClientRect(
|
|
26
|
+
function reset() {
|
|
27
|
+
const { top, bottom } = getBoundingClientRect()
|
|
38
28
|
const { innerHeight } = window
|
|
39
|
-
const out_is_active= out_is_active_(top, bottom)
|
|
29
|
+
const out_is_active = out_is_active_(top, bottom)
|
|
40
30
|
const out_is_visible = out_is_visible_(top, bottom, innerHeight)
|
|
41
31
|
if (out_is_visible) {
|
|
42
32
|
if (!visible) {
|
|
@@ -59,30 +49,30 @@ function reset(event) {
|
|
|
59
49
|
}
|
|
60
50
|
function add_active() {
|
|
61
51
|
active = true
|
|
62
|
-
dispatch('add_active',
|
|
52
|
+
dispatch('add_active', event_())
|
|
63
53
|
}
|
|
64
54
|
function remove_active() {
|
|
65
55
|
active = false
|
|
66
|
-
dispatch('remove_active',
|
|
56
|
+
dispatch('remove_active', event_())
|
|
67
57
|
}
|
|
68
58
|
function add_visible() {
|
|
69
59
|
visible = true
|
|
70
|
-
dispatch('add_visible',
|
|
60
|
+
dispatch('add_visible', event_())
|
|
71
61
|
}
|
|
72
62
|
function remove_visible() {
|
|
73
63
|
visible = false
|
|
74
|
-
dispatch('remove_visible',
|
|
64
|
+
dispatch('remove_visible', event_())
|
|
75
65
|
}
|
|
76
|
-
function default_getBoundingClientRect() {
|
|
77
|
-
return root
|
|
66
|
+
function default_getBoundingClientRect():DOMRect {
|
|
67
|
+
return root!.getBoundingClientRect()
|
|
78
68
|
}
|
|
79
69
|
function contains_visible() {
|
|
80
|
-
return root
|
|
70
|
+
return root!.classList.contains('visible')
|
|
81
71
|
}
|
|
82
72
|
function contains_active() {
|
|
83
|
-
return root
|
|
73
|
+
return root!.classList.contains('active')
|
|
84
74
|
}
|
|
85
|
-
function
|
|
75
|
+
function event_() {
|
|
86
76
|
return {
|
|
87
77
|
root,
|
|
88
78
|
target: root,
|
|
@@ -92,14 +82,10 @@ function _event() {
|
|
|
92
82
|
</script>
|
|
93
83
|
|
|
94
84
|
<svelte:window
|
|
95
|
-
on:scroll=
|
|
96
|
-
on:resize=
|
|
85
|
+
on:scroll={reset}
|
|
86
|
+
on:resize={reset}
|
|
97
87
|
/>
|
|
98
88
|
|
|
99
|
-
<div
|
|
100
|
-
bind:this="{root}"
|
|
101
|
-
class="Sticky_Scroll {$$props.class||''}"
|
|
102
|
-
class:active="{active}"
|
|
103
|
-
>
|
|
89
|
+
<div bind:this={root} class="Sticky_Scroll {$$props.class||''}" class:active>
|
|
104
90
|
<slot></slot>
|
|
105
91
|
</div>
|
package/src/ui/index.ts
CHANGED