@ctx-core/scroll 12.0.70 → 12.0.71

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ctx-core/scroll
2
2
 
3
+ ## 12.0.71
4
+
5
+ ### Patch Changes
6
+
7
+ - Sticky_Scroll: lang=ts
8
+
3
9
  ## 12.0.70
4
10
 
5
11
  ### 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"}
@@ -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.70",
3
+ "version": "12.0.71",
4
4
  "description": "ctx-core scroll",
5
5
  "keywords": [
6
6
  "ctx-core",
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'
@@ -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'