@ctx-core/scroll 12.0.64 → 12.0.69
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 +10 -0
- package/CHANGELOG.md +42 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/is_active_.js +3 -2
- package/dist/is_active_.js.map +1 -1
- package/dist/is_visible_.js +4 -3
- package/dist/is_visible_.js.map +1 -1
- package/dist/out_is_active_.js +1 -0
- package/dist/out_is_active_.js.map +1 -1
- package/dist/out_is_visible_.js +3 -3
- package/dist/out_is_visible_.js.map +1 -1
- package/dist/scroll_Ctx.js +2 -1
- package/dist/scroll_Ctx.js.map +1 -1
- package/dist/scroll_ctx_I.generated.js +4 -1
- package/dist/scroll_ctx_I.generated.js.map +1 -1
- package/dist/sticky_scroll_active$_b.js +11 -11
- package/dist/sticky_scroll_active$_b.js.map +1 -1
- package/dist/ui/Sticky_Scroll.svelte +105 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/package.json +15 -16
- package/COMMIT_EDITMSG +0 -2
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/is_active_.d.ts +0 -2
- package/dist/is_visible_.d.ts +0 -2
- package/dist/out_is_active_.d.ts +0 -1
- package/dist/out_is_visible_.d.ts +0 -2
- package/dist/scroll_Ctx.d.ts +0 -3
- package/dist/scroll_ctx_I.generated.d.ts +0 -4
- package/dist/sticky_scroll_active$_b.d.ts +0 -14
- package/dist/ui/index.d.ts +0 -3
package/.swcrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @ctx-core/scroll
|
|
2
2
|
|
|
3
|
+
## 12.0.69
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- compile using swc
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @ctx-core/object@21.0.22
|
|
10
|
+
- @ctx-core/store@27.0.36
|
|
11
|
+
|
|
12
|
+
## 12.0.68
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- svelte: 3.44.0 -> 3.44.1
|
|
17
|
+
- Updated dependencies [undefined]
|
|
18
|
+
- @ctx-core/store@27.0.35
|
|
19
|
+
|
|
20
|
+
## 12.0.67
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- typescript: ^4.4.3 -> ^4.4.4
|
|
25
|
+
- svelte: 3.43.1 -> 3.44.0
|
|
26
|
+
- Updated dependencies [undefined]
|
|
27
|
+
- Updated dependencies [undefined]
|
|
28
|
+
- @ctx-core/object@21.0.21
|
|
29
|
+
- @ctx-core/store@27.0.34
|
|
30
|
+
|
|
31
|
+
## 12.0.66
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- update dependencies
|
|
36
|
+
|
|
37
|
+
## 12.0.65
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- svelte: 3.43.0 -> 3.43.1
|
|
42
|
+
- Updated dependencies [undefined]
|
|
43
|
+
- @ctx-core/store@27.0.33
|
|
44
|
+
|
|
3
45
|
## 12.0.64
|
|
4
46
|
|
|
5
47
|
### Patch Changes
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,CAAM"}
|
package/dist/is_active_.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { out_is_active_ } from './out_is_active_.js';
|
|
2
2
|
export function is_active_(el) {
|
|
3
|
-
const { top, bottom
|
|
3
|
+
const { top , bottom } = el.getBoundingClientRect();
|
|
4
4
|
return out_is_active_(top, bottom);
|
|
5
5
|
}
|
|
6
|
-
export { is_active_ as _is_active,
|
|
6
|
+
export { is_active_ as _is_active, };
|
|
7
|
+
|
|
7
8
|
//# sourceMappingURL=is_active_.js.map
|
package/dist/is_active_.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/is_active_.ts"],"sourcesContent":["import { out_is_active_ } from './out_is_active_.js'\nexport function is_active_(el:HTMLElement) {\n\tconst { top, bottom } = el.getBoundingClientRect()\n\treturn out_is_active_(top, bottom)\n}\nexport {\n\tis_active_ as _is_active,\n}\n"],"names":["out_is_active_","is_active_","el","top","bottom","getBoundingClientRect","_is_active"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,UAAU,CAACC,EAAc,EAAE,CAAC;IAC3C,KAAK,CAAC,CAAC,CAACC,GAAG,GAAEC,MAAM,EAAC,CAAC,GAAGF,EAAE,CAACG,qBAAqB;IAChD,MAAM,CAACL,cAAc,CAACG,GAAG,EAAEC,MAAM;AAClC,CAAC;AACD,MAAM,GACLH,UAAU,IAAIK,UAAU"}
|
package/dist/is_visible_.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { out_is_visible_ } from './out_is_visible_.js';
|
|
2
2
|
export function is_visible_(el) {
|
|
3
|
-
const { top, bottom
|
|
4
|
-
const { innerHeight
|
|
3
|
+
const { top , bottom } = el.getBoundingClientRect();
|
|
4
|
+
const { innerHeight } = window;
|
|
5
5
|
return out_is_visible_(top, bottom, innerHeight);
|
|
6
6
|
}
|
|
7
|
-
export { is_visible_ as _is_visible,
|
|
7
|
+
export { is_visible_ as _is_visible, };
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=is_visible_.js.map
|
package/dist/is_visible_.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/is_visible_.ts"],"sourcesContent":["import { out_is_visible_ } from './out_is_visible_.js'\nexport function is_visible_(el:HTMLElement) {\n\tconst { top, bottom } = el.getBoundingClientRect()\n\tconst { innerHeight } = window\n\treturn out_is_visible_(top, bottom, innerHeight)\n}\nexport {\n\tis_visible_ as _is_visible,\n}\n"],"names":["out_is_visible_","is_visible_","el","top","bottom","getBoundingClientRect","innerHeight","window","_is_visible"],"mappings":"AAAA,MAAM,GAAGA,eAAe,QAAQ,CAAsB;AACtD,MAAM,UAAUC,WAAW,CAACC,EAAc,EAAE,CAAC;IAC5C,KAAK,CAAC,CAAC,CAACC,GAAG,GAAEC,MAAM,EAAC,CAAC,GAAGF,EAAE,CAACG,qBAAqB;IAChD,KAAK,CAAC,CAAC,CAACC,WAAW,EAAC,CAAC,GAAGC,MAAM;IAC9B,MAAM,CAACP,eAAe,CAACG,GAAG,EAAEC,MAAM,EAAEE,WAAW;AAChD,CAAC;AACD,MAAM,GACLL,WAAW,IAAIO,WAAW"}
|
package/dist/out_is_active_.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/out_is_active_.ts"],"sourcesContent":["export function out_is_active_(top:number, bottom:number) {\n\treturn top <= 0 && bottom >= 0\n}\n"],"names":["out_is_active_","top","bottom"],"mappings":"AAAA,MAAM,UAAUA,cAAc,CAACC,GAAU,EAAEC,MAAa,EAAE,CAAC;IAC1D,MAAM,CAACD,GAAG,IAAI,CAAC,IAAIC,MAAM,IAAI,CAAC;AAC/B,CAAC"}
|
package/dist/out_is_visible_.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { out_is_active_ } from './out_is_active_.js';
|
|
2
2
|
export function out_is_visible_(top, bottom, innerHeight) {
|
|
3
|
-
return
|
|
4
|
-
|| out_is_active_(top, bottom);
|
|
3
|
+
return top > 0 && top < innerHeight || out_is_active_(top, bottom);
|
|
5
4
|
}
|
|
6
|
-
export { out_is_visible_ as _out_is_visible,
|
|
5
|
+
export { out_is_visible_ as _out_is_visible, };
|
|
6
|
+
|
|
7
7
|
//# sourceMappingURL=out_is_visible_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/out_is_visible_.ts"],"sourcesContent":["import { out_is_active_ } from './out_is_active_.js'\nexport function out_is_visible_(top:number, bottom:number, innerHeight:number) {\n\treturn (top > 0 && top < innerHeight)\n\t\t|| out_is_active_(top, bottom)\n}\nexport {\n\tout_is_visible_ as _out_is_visible,\n}\n"],"names":["out_is_active_","out_is_visible_","top","bottom","innerHeight","_out_is_visible"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,eAAe,CAACC,GAAU,EAAEC,MAAa,EAAEC,WAAkB,EAAE,CAAC;IAC/E,MAAM,CAAEF,GAAG,GAAG,CAAC,IAAIA,GAAG,GAAGE,WAAW,IAChCJ,cAAc,CAACE,GAAG,EAAEC,MAAM;AAC/B,CAAC;AACD,MAAM,GACLF,eAAe,IAAII,eAAe"}
|
package/dist/scroll_Ctx.js
CHANGED
package/dist/scroll_Ctx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/scroll_Ctx.ts"],"sourcesContent":["import type { scroll_ctx_I } from './scroll_ctx_I.generated.js'\nexport interface scroll_Ctx extends scroll_ctx_I {\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/scroll_ctx_I.generated.ts"],"sourcesContent":["/*\n * This file was generated by `npm run generate_ctx_I_file` in @ctx-core/dev-tools\n*/\nimport type { sticky_scroll_active$_T } from './sticky_scroll_active$_b.js'\nexport interface scroll_ctx_I {\n\tsticky_scroll_active$?:sticky_scroll_active$_T\n}"],"names":[],"mappings":"AAAA,EAEE,AAFF;;AAEE,AAFF,EAEE,CACF,MAAM"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { assign, b_ } from '@ctx-core/object';
|
|
2
2
|
import { writable$ } from '@ctx-core/store';
|
|
3
|
-
const
|
|
4
|
-
export const sticky_scroll_active$_b = b_(
|
|
5
|
-
const sticky_scroll_active$ = writable$({
|
|
3
|
+
const key1 = 'sticky_scroll_active$';
|
|
4
|
+
export const sticky_scroll_active$_b = b_(key1, ()=>{
|
|
5
|
+
const sticky_scroll_active$ = writable$({
|
|
6
|
+
});
|
|
6
7
|
return assign(sticky_scroll_active$, {
|
|
7
8
|
add_sticky_scroll_active,
|
|
8
9
|
remove_sticky_scroll_active,
|
|
9
10
|
sticky_scroll_active_key_active_,
|
|
10
|
-
sticky_scroll_active_key_match_
|
|
11
|
+
sticky_scroll_active_key_match_
|
|
11
12
|
});
|
|
12
13
|
function add_sticky_scroll_active(key) {
|
|
13
|
-
sticky_scroll_active$.update(scroll_sticky_active
|
|
14
|
+
sticky_scroll_active$.update((scroll_sticky_active)=>{
|
|
14
15
|
scroll_sticky_active[key] = true;
|
|
15
16
|
return scroll_sticky_active;
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
function remove_sticky_scroll_active(key) {
|
|
19
|
-
sticky_scroll_active$.update(scroll_sticky_active
|
|
20
|
+
sticky_scroll_active$.update((scroll_sticky_active)=>{
|
|
20
21
|
scroll_sticky_active[key] = false;
|
|
21
22
|
return scroll_sticky_active;
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
function sticky_scroll_active_key_active_(key) {
|
|
25
26
|
const sticky_scroll_active = sticky_scroll_active$._;
|
|
26
|
-
const active = sticky_scroll_active
|
|
27
|
-
? sticky_scroll_active[key]
|
|
28
|
-
: false;
|
|
27
|
+
const active = sticky_scroll_active ? sticky_scroll_active[key] : false;
|
|
29
28
|
return active;
|
|
30
29
|
}
|
|
31
30
|
function sticky_scroll_active_key_match_(key, active) {
|
|
32
|
-
return !!
|
|
31
|
+
return !!active == !!sticky_scroll_active_key_active_(key);
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
|
-
export { sticky_scroll_active$_b as b__active__Sticky__Scroll,
|
|
34
|
+
export { sticky_scroll_active$_b as b__active__Sticky__Scroll, };
|
|
35
|
+
|
|
36
36
|
//# sourceMappingURL=sticky_scroll_active$_b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script>
|
|
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_'
|
|
5
|
+
const dispatch = createEventDispatcher()
|
|
6
|
+
let getBoundingClientRect = default_getBoundingClientRect
|
|
7
|
+
let terminal = null
|
|
8
|
+
let root = null
|
|
9
|
+
let active
|
|
10
|
+
let visible
|
|
11
|
+
onMount(() => {
|
|
12
|
+
reset({})
|
|
13
|
+
if (terminal) {
|
|
14
|
+
if (terminal.addEventListener) {
|
|
15
|
+
terminal.addEventListener('scroll', reset)
|
|
16
|
+
} else if (terminal.on) {
|
|
17
|
+
terminal.on('scroll', reset)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
onDestroy(() => {
|
|
22
|
+
if (terminal) {
|
|
23
|
+
if (terminal.removeEventListener) {
|
|
24
|
+
terminal.removeEventListener('scroll', reset)
|
|
25
|
+
} else if (terminal.off) {
|
|
26
|
+
terminal.off('scroll', reset)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (contains_visible()) {
|
|
30
|
+
remove_visible()
|
|
31
|
+
}
|
|
32
|
+
if (contains_active()) {
|
|
33
|
+
remove_active()
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
function reset(event) {
|
|
37
|
+
const { top, bottom } = getBoundingClientRect(root)
|
|
38
|
+
const { innerHeight } = window
|
|
39
|
+
const out_is_active= out_is_active_(top, bottom)
|
|
40
|
+
const out_is_visible = out_is_visible_(top, bottom, innerHeight)
|
|
41
|
+
if (out_is_visible) {
|
|
42
|
+
if (!visible) {
|
|
43
|
+
add_visible()
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
if (visible) {
|
|
47
|
+
remove_visible()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (out_is_active) {
|
|
51
|
+
if (!active) {
|
|
52
|
+
add_active()
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
if (active) {
|
|
56
|
+
remove_active()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function add_active() {
|
|
61
|
+
active = true
|
|
62
|
+
dispatch('add_active', _event())
|
|
63
|
+
}
|
|
64
|
+
function remove_active() {
|
|
65
|
+
active = false
|
|
66
|
+
dispatch('remove_active', _event())
|
|
67
|
+
}
|
|
68
|
+
function add_visible() {
|
|
69
|
+
visible = true
|
|
70
|
+
dispatch('add_visible', _event())
|
|
71
|
+
}
|
|
72
|
+
function remove_visible() {
|
|
73
|
+
visible = false
|
|
74
|
+
dispatch('remove_visible', _event())
|
|
75
|
+
}
|
|
76
|
+
function default_getBoundingClientRect() {
|
|
77
|
+
return root.getBoundingClientRect()
|
|
78
|
+
}
|
|
79
|
+
function contains_visible() {
|
|
80
|
+
return root.classList.contains('visible')
|
|
81
|
+
}
|
|
82
|
+
function contains_active() {
|
|
83
|
+
return root.classList.contains('active')
|
|
84
|
+
}
|
|
85
|
+
function _event() {
|
|
86
|
+
return {
|
|
87
|
+
root,
|
|
88
|
+
target: root,
|
|
89
|
+
currentTarget: root,
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<svelte:window
|
|
95
|
+
on:scroll="{reset}"
|
|
96
|
+
on:resize="{reset}"
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<div
|
|
100
|
+
bind:this="{root}"
|
|
101
|
+
class="Sticky_Scroll {$$props.class||''}"
|
|
102
|
+
class:active="{active}"
|
|
103
|
+
>
|
|
104
|
+
<slot></slot>
|
|
105
|
+
</div>
|
package/dist/ui/index.js
CHANGED
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["import 'svelte'\nimport Sticky_Scroll from './Sticky_Scroll.svelte'\nexport { Sticky_Scroll }\n"],"names":["Sticky_Scroll"],"mappings":"AAAA,MAAM,CAAC,CAAQ;AACf,MAAM,CAACA,aAAa,MAAM,CAAwB;AAClD,MAAM,GAAGA,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.69",
|
|
4
4
|
"description": "ctx-core scroll",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Brian Takita",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"main": "./dist/index.
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
21
|
"module": "./dist/index.js",
|
|
22
|
-
"types": "./
|
|
22
|
+
"types": "./src/index.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"require": "./dist/index.cjs",
|
|
@@ -28,27 +28,26 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctx-core/object": "^21.0.
|
|
32
|
-
"@ctx-core/store": "^27.0.
|
|
33
|
-
"
|
|
34
|
-
"svelte": "3.43.0"
|
|
31
|
+
"@ctx-core/object": "^21.0.22",
|
|
32
|
+
"@ctx-core/store": "^27.0.36",
|
|
33
|
+
"svelte": "3.44.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@ctx-core/ctx-core-package-tools": "^8.0.
|
|
38
|
-
"@ctx-core/dev-tools": "^7.
|
|
39
|
-
"
|
|
36
|
+
"@ctx-core/ctx-core-package-tools": "^8.0.77",
|
|
37
|
+
"@ctx-core/dev-tools": "^7.2.0",
|
|
38
|
+
"@swc/cli": "^0.1.51",
|
|
39
|
+
"@swc/core": "^1.2.107",
|
|
40
|
+
"typescript": "^4.4.4"
|
|
40
41
|
},
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public",
|
|
43
44
|
"cache": "~/.npm"
|
|
44
45
|
},
|
|
45
46
|
"scripts": {
|
|
46
|
-
"build": "npm run
|
|
47
|
-
"clean": "rm -
|
|
48
|
-
"compile": "
|
|
49
|
-
"copy-mjs": "cd dist && echo \"module.exports = (async () => import('./index.js'))()\" > index.cjs",
|
|
50
|
-
"copy-components": "cd src && find . | grep \\.svelte$ | awk '{print \"mkdir -p dirname \"$1\" && cp -f \"$1\" ../dist/\"$1}'",
|
|
47
|
+
"build": "npm run generate_ctx_I_file && npm run compile",
|
|
48
|
+
"clean": "rm -rf dist",
|
|
49
|
+
"compile": "swc src --out-dir dist --copy-files --source-maps --config-file .swcrc",
|
|
51
50
|
"exec": "$@",
|
|
52
|
-
"generate_ctx_I_file": "./node_modules/.bin/generate_ctx_I_file"
|
|
51
|
+
"generate_ctx_I_file": "swc $(./node_modules/.bin/generate_ctx_I_file | tail -n1) --out-dir dist --source-maps --config-file .swcrc"
|
|
53
52
|
}
|
|
54
53
|
}
|
package/COMMIT_EDITMSG
DELETED
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = (async () => import('./index.js'))()
|
package/dist/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './scroll_Ctx.js';
|
|
2
|
-
export * from './scroll_ctx_I.generated.js';
|
|
3
|
-
export * from './is_active_.js';
|
|
4
|
-
export * from './is_visible_.js';
|
|
5
|
-
export * from './out_is_active_.js';
|
|
6
|
-
export * from './out_is_visible_.js';
|
|
7
|
-
export * from './sticky_scroll_active$_b.js';
|
|
8
|
-
export * from './ui';
|
package/dist/is_active_.d.ts
DELETED
package/dist/is_visible_.d.ts
DELETED
package/dist/out_is_active_.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function out_is_active_(top: number, bottom: number): boolean;
|
package/dist/scroll_Ctx.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
|
-
import type { scroll_Ctx } from './scroll_Ctx';
|
|
4
|
-
declare const key = "sticky_scroll_active$";
|
|
5
|
-
export declare const sticky_scroll_active$_b: B<scroll_Ctx, typeof key>;
|
|
6
|
-
export interface sticky_scroll_active_T extends Record<string, boolean> {
|
|
7
|
-
}
|
|
8
|
-
export interface sticky_scroll_active$_T extends Writable$<sticky_scroll_active_T> {
|
|
9
|
-
add_sticky_scroll_active: (key: string) => void;
|
|
10
|
-
remove_sticky_scroll_active: (key: string) => void;
|
|
11
|
-
sticky_scroll_active_key_active_: (key: string) => void;
|
|
12
|
-
sticky_scroll_active_key_match_: (key: string, active: any) => void;
|
|
13
|
-
}
|
|
14
|
-
export { sticky_scroll_active$_b as b__active__Sticky__Scroll, };
|
package/dist/ui/index.d.ts
DELETED