@ctx-core/scroll 13.0.0 → 14.0.0
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/CHANGELOG.md +6 -0
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/src/index.ts +0 -1
- package/COMMIT_EDITMSG +0 -1
- package/dist/ui/Sticky_Scroll.svelte +0 -91
- package/dist/ui/index.js +0 -5
- package/dist/ui/index.js.map +0 -1
- package/src/ui/Sticky_Scroll.svelte +0 -91
- package/src/ui/index.ts +0 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * 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'\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * 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'\n"],"names":[],"mappings":"cAAc,CAAiB;cACjB,CAAkB;cAClB,CAAqB;cACrB,CAAsB;cACtB,CAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/scroll",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "ctx-core scroll",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -17,22 +17,21 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Brian Takita",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"types": "./src/index.ts",
|
|
21
20
|
"exports": {
|
|
22
21
|
".": {
|
|
22
|
+
"types": "./src/index.ts",
|
|
23
23
|
"import": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@ctx-core/object": "^22.0.0",
|
|
29
|
-
"@ctx-core/store": "^27.0.46"
|
|
30
|
-
"svelte": "3.44.2"
|
|
29
|
+
"@ctx-core/store": "^27.0.46"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@ctx-core/ctx-core-package-tools": "^8.0.85",
|
|
34
|
-
"@swc/cli": "^0.1.
|
|
35
|
-
"@swc/core": "^1.2.
|
|
33
|
+
"@swc/cli": "^0.1.55",
|
|
34
|
+
"@swc/core": "^1.2.120",
|
|
36
35
|
"typescript": "next"
|
|
37
36
|
},
|
|
38
37
|
"publishConfig": {
|
package/src/index.ts
CHANGED
package/COMMIT_EDITMSG
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
|
3
|
-
import { out_is_active_ } from '../out_is_active_.js'
|
|
4
|
-
import { out_is_visible_ } from '../out_is_visible_.js'
|
|
5
|
-
const dispatch = createEventDispatcher()
|
|
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()
|
|
11
|
-
if (terminal) {
|
|
12
|
-
terminal.addEventListener('scroll', reset)
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
onDestroy(()=>{
|
|
16
|
-
if (terminal) {
|
|
17
|
-
terminal.removeEventListener('scroll', reset)
|
|
18
|
-
}
|
|
19
|
-
if (contains_visible()) {
|
|
20
|
-
remove_visible()
|
|
21
|
-
}
|
|
22
|
-
if (contains_active()) {
|
|
23
|
-
remove_active()
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
function reset() {
|
|
27
|
-
const { top, bottom } = getBoundingClientRect()
|
|
28
|
-
const { innerHeight } = window
|
|
29
|
-
const out_is_active = out_is_active_(top, bottom)
|
|
30
|
-
const out_is_visible = out_is_visible_(top, bottom, innerHeight)
|
|
31
|
-
if (out_is_visible) {
|
|
32
|
-
if (!visible) {
|
|
33
|
-
add_visible()
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
if (visible) {
|
|
37
|
-
remove_visible()
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (out_is_active) {
|
|
41
|
-
if (!active) {
|
|
42
|
-
add_active()
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
if (active) {
|
|
46
|
-
remove_active()
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function add_active() {
|
|
51
|
-
active = true
|
|
52
|
-
dispatch('add_active', event_())
|
|
53
|
-
}
|
|
54
|
-
function remove_active() {
|
|
55
|
-
active = false
|
|
56
|
-
dispatch('remove_active', event_())
|
|
57
|
-
}
|
|
58
|
-
function add_visible() {
|
|
59
|
-
visible = true
|
|
60
|
-
dispatch('add_visible', event_())
|
|
61
|
-
}
|
|
62
|
-
function remove_visible() {
|
|
63
|
-
visible = false
|
|
64
|
-
dispatch('remove_visible', event_())
|
|
65
|
-
}
|
|
66
|
-
function default_getBoundingClientRect():DOMRect {
|
|
67
|
-
return root!.getBoundingClientRect()
|
|
68
|
-
}
|
|
69
|
-
function contains_visible() {
|
|
70
|
-
return root!.classList.contains('visible')
|
|
71
|
-
}
|
|
72
|
-
function contains_active() {
|
|
73
|
-
return root!.classList.contains('active')
|
|
74
|
-
}
|
|
75
|
-
function event_() {
|
|
76
|
-
return {
|
|
77
|
-
root,
|
|
78
|
-
target: root,
|
|
79
|
-
currentTarget: root,
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<svelte:window
|
|
85
|
-
on:scroll={reset}
|
|
86
|
-
on:resize={reset}
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
<div bind:this={root} class="Sticky_Scroll {$$props.class||''}" class:active>
|
|
90
|
-
<slot></slot>
|
|
91
|
-
</div>
|
package/dist/ui/index.js
DELETED
package/dist/ui/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
|
3
|
-
import { out_is_active_ } from '../out_is_active_.js'
|
|
4
|
-
import { out_is_visible_ } from '../out_is_visible_.js'
|
|
5
|
-
const dispatch = createEventDispatcher()
|
|
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()
|
|
11
|
-
if (terminal) {
|
|
12
|
-
terminal.addEventListener('scroll', reset)
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
onDestroy(()=>{
|
|
16
|
-
if (terminal) {
|
|
17
|
-
terminal.removeEventListener('scroll', reset)
|
|
18
|
-
}
|
|
19
|
-
if (contains_visible()) {
|
|
20
|
-
remove_visible()
|
|
21
|
-
}
|
|
22
|
-
if (contains_active()) {
|
|
23
|
-
remove_active()
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
function reset() {
|
|
27
|
-
const { top, bottom } = getBoundingClientRect()
|
|
28
|
-
const { innerHeight } = window
|
|
29
|
-
const out_is_active = out_is_active_(top, bottom)
|
|
30
|
-
const out_is_visible = out_is_visible_(top, bottom, innerHeight)
|
|
31
|
-
if (out_is_visible) {
|
|
32
|
-
if (!visible) {
|
|
33
|
-
add_visible()
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
if (visible) {
|
|
37
|
-
remove_visible()
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (out_is_active) {
|
|
41
|
-
if (!active) {
|
|
42
|
-
add_active()
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
if (active) {
|
|
46
|
-
remove_active()
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function add_active() {
|
|
51
|
-
active = true
|
|
52
|
-
dispatch('add_active', event_())
|
|
53
|
-
}
|
|
54
|
-
function remove_active() {
|
|
55
|
-
active = false
|
|
56
|
-
dispatch('remove_active', event_())
|
|
57
|
-
}
|
|
58
|
-
function add_visible() {
|
|
59
|
-
visible = true
|
|
60
|
-
dispatch('add_visible', event_())
|
|
61
|
-
}
|
|
62
|
-
function remove_visible() {
|
|
63
|
-
visible = false
|
|
64
|
-
dispatch('remove_visible', event_())
|
|
65
|
-
}
|
|
66
|
-
function default_getBoundingClientRect():DOMRect {
|
|
67
|
-
return root!.getBoundingClientRect()
|
|
68
|
-
}
|
|
69
|
-
function contains_visible() {
|
|
70
|
-
return root!.classList.contains('visible')
|
|
71
|
-
}
|
|
72
|
-
function contains_active() {
|
|
73
|
-
return root!.classList.contains('active')
|
|
74
|
-
}
|
|
75
|
-
function event_() {
|
|
76
|
-
return {
|
|
77
|
-
root,
|
|
78
|
-
target: root,
|
|
79
|
-
currentTarget: root,
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<svelte:window
|
|
85
|
-
on:scroll={reset}
|
|
86
|
-
on:resize={reset}
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
<div bind:this={root} class="Sticky_Scroll {$$props.class||''}" class:active>
|
|
90
|
-
<slot></slot>
|
|
91
|
-
</div>
|
package/src/ui/index.ts
DELETED