@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "jsc": {
3
- "target": "es2019",
3
+ "target": "es2020",
4
4
  "parser": {
5
5
  "syntax": "typescript",
6
6
  "tsx": true,
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
@@ -5,6 +5,6 @@ export * from './is_visible_.js';
5
5
  export * from './out_is_active_.js';
6
6
  export * from './out_is_visible_.js';
7
7
  export * from './sticky_scroll_active$_b.js';
8
- export * from './ui';
8
+ export * from './ui/index.js';
9
9
 
10
10
  //# sourceMappingURL=index.js.map
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,CAAM"}
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$._\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
+ {"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 getBoundingClientRect = default_getBoundingClientRect
7
- let terminal = null
8
- let root = null
9
- let active
10
- let visible
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
- if (terminal.addEventListener) {
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
- if (terminal.removeEventListener) {
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(event) {
37
- const { top, bottom } = getBoundingClientRect(root)
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', _event())
52
+ dispatch('add_active', event_())
63
53
  }
64
54
  function remove_active() {
65
55
  active = false
66
- dispatch('remove_active', _event())
56
+ dispatch('remove_active', event_())
67
57
  }
68
58
  function add_visible() {
69
59
  visible = true
70
- dispatch('add_visible', _event())
60
+ dispatch('add_visible', event_())
71
61
  }
72
62
  function remove_visible() {
73
63
  visible = false
74
- dispatch('remove_visible', _event())
64
+ dispatch('remove_visible', event_())
75
65
  }
76
- function default_getBoundingClientRect() {
77
- return root.getBoundingClientRect()
66
+ function default_getBoundingClientRect():DOMRect {
67
+ return root!.getBoundingClientRect()
78
68
  }
79
69
  function contains_visible() {
80
- return root.classList.contains('visible')
70
+ return root!.classList.contains('visible')
81
71
  }
82
72
  function contains_active() {
83
- return root.classList.contains('active')
73
+ return root!.classList.contains('active')
84
74
  }
85
- function _event() {
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="{reset}"
96
- on:resize="{reset}"
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
@@ -1,5 +1,5 @@
1
1
  import 'svelte';
2
- import Sticky_Scroll from './Sticky_Scroll.svelte';
3
- export { Sticky_Scroll };
2
+ import * as _Sticky_Scroll from './Sticky_Scroll.svelte';
3
+ export { _Sticky_Scroll as Sticky_Scroll };
4
4
 
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
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.69",
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.22",
32
- "@ctx-core/store": "^27.0.36",
33
- "svelte": "3.44.1"
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.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"
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
@@ -5,4 +5,4 @@ export * from './is_visible_.js'
5
5
  export * from './out_is_active_.js'
6
6
  export * from './out_is_visible_.js'
7
7
  export * from './sticky_scroll_active$_b.js'
8
- export * from './ui'
8
+ export * from './ui/index.js'
@@ -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 getBoundingClientRect = default_getBoundingClientRect
7
- let terminal = null
8
- let root = null
9
- let active
10
- let visible
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
- if (terminal.addEventListener) {
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
- if (terminal.removeEventListener) {
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(event) {
37
- const { top, bottom } = getBoundingClientRect(root)
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', _event())
52
+ dispatch('add_active', event_())
63
53
  }
64
54
  function remove_active() {
65
55
  active = false
66
- dispatch('remove_active', _event())
56
+ dispatch('remove_active', event_())
67
57
  }
68
58
  function add_visible() {
69
59
  visible = true
70
- dispatch('add_visible', _event())
60
+ dispatch('add_visible', event_())
71
61
  }
72
62
  function remove_visible() {
73
63
  visible = false
74
- dispatch('remove_visible', _event())
64
+ dispatch('remove_visible', event_())
75
65
  }
76
- function default_getBoundingClientRect() {
77
- return root.getBoundingClientRect()
66
+ function default_getBoundingClientRect():DOMRect {
67
+ return root!.getBoundingClientRect()
78
68
  }
79
69
  function contains_visible() {
80
- return root.classList.contains('visible')
70
+ return root!.classList.contains('visible')
81
71
  }
82
72
  function contains_active() {
83
- return root.classList.contains('active')
73
+ return root!.classList.contains('active')
84
74
  }
85
- function _event() {
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="{reset}"
96
- on:resize="{reset}"
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
@@ -1,3 +1,2 @@
1
1
  import 'svelte'
2
- import Sticky_Scroll from './Sticky_Scroll.svelte'
3
- export { Sticky_Scroll }
2
+ export * as Sticky_Scroll from './Sticky_Scroll.svelte'