@ctx-core/scroll 13.0.0 → 14.0.4

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,56 @@
1
1
  # @ctx-core/scroll
2
2
 
3
+ ## 14.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: build
8
+ - Updated dependencies
9
+ - @ctx-core/object@22.0.5
10
+ - @ctx-core/store@27.0.52
11
+
12
+ ## 14.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - \*.d.ts export
17
+ - Updated dependencies
18
+ - @ctx-core/object@22.0.4
19
+ - @ctx-core/store@27.0.51
20
+
21
+ ## 14.0.2
22
+
23
+ ### Patch Changes
24
+
25
+ - fix: tsconfig.json: "rootDir": "."
26
+ - Updated dependencies
27
+ - @ctx-core/object@22.0.3
28
+ - @ctx-core/store@27.0.50
29
+
30
+ ## 14.0.1
31
+
32
+ ### Patch Changes
33
+
34
+ - fix: package.json: exports
35
+ - Updated dependencies
36
+ - @ctx-core/object@22.0.2
37
+ - @ctx-core/store@27.0.49
38
+
39
+ ## 14.0.1
40
+
41
+ ### Patch Changes
42
+
43
+ - package.json: svelte: ./dist/index.js
44
+ - Updated dependencies
45
+ - @ctx-core/object@22.0.1
46
+ - @ctx-core/store@27.0.48
47
+
48
+ ## 14.0.0
49
+
50
+ ### Major Changes
51
+
52
+ - extracted @ctx-core/scroll-ui-svelte
53
+
3
54
  ## 13.0.0
4
55
 
5
56
  ### Major Changes
package/dist/index.js CHANGED
@@ -3,6 +3,5 @@ export * from './is_visible_.js';
3
3
  export * from './out_is_active_.js';
4
4
  export * from './out_is_visible_.js';
5
5
  export * from './sticky_scroll_active$_b.js';
6
- export * from './ui/index.js';
7
6
 
8
7
  //# sourceMappingURL=index.js.map
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'\nexport * from './ui/index.js'\n"],"names":[],"mappings":"cAAc,CAAiB;cACjB,CAAkB;cAClB,CAAqB;cACrB,CAAsB;cACtB,CAA8B;cAC9B,CAAe"}
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": "13.0.0",
3
+ "version": "14.0.4",
4
4
  "description": "ctx-core scroll",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/ctx-core/scroll/issues"
15
+ "url": "https://github.com/ctx-core/scroll.git"
16
16
  },
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "types": "./src/index.ts",
20
+ "types": "./dist/index.d.ts",
21
21
  "exports": {
22
22
  ".": {
23
23
  "import": "./dist/index.js"
@@ -25,23 +25,25 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@ctx-core/object": "^22.0.0",
29
- "@ctx-core/store": "^27.0.46",
30
- "svelte": "3.44.2"
28
+ "@ctx-core/object": "^22.0.5",
29
+ "@ctx-core/store": "^27.0.52"
31
30
  },
32
31
  "devDependencies": {
33
- "@ctx-core/ctx-core-package-tools": "^8.0.85",
34
- "@swc/cli": "^0.1.52",
35
- "@swc/core": "^1.2.118",
32
+ "@ctx-core/ctx-core-package-tools": "^8.0.92",
33
+ "@swc/cli": "^0.1.55",
34
+ "@swc/core": "^1.2.120",
35
+ "rimraf": "^3.0.2",
36
36
  "typescript": "next"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public",
40
40
  "cache": "~/.npm"
41
41
  },
42
+ "svelte": "./dist/index.js",
42
43
  "scripts": {
43
44
  "build": "npm run compile",
44
- "clean": "rm -rf dist",
45
+ "clean": "rimraf dist && npm run clean_tsbuildinfo",
46
+ "clean_tsbuildinfo": "rm -f tsconfig.tsbuildinfo && rm -f dist/**/*.d.ts",
45
47
  "compile": "swc src --out-dir dist --copy-files --source-maps --config-file .swcrc",
46
48
  "exec": "$@"
47
49
  }
package/src/index.ts CHANGED
@@ -3,4 +3,3 @@ export * from './is_visible_.js'
3
3
  export * from './out_is_active_.js'
4
4
  export * from './out_is_visible_.js'
5
5
  export * from './sticky_scroll_active$_b.js'
6
- export * from './ui/index.js'
package/tsconfig.json CHANGED
@@ -23,7 +23,6 @@
23
23
  ],
24
24
  "rootDir": "src",
25
25
  "outDir": "dist",
26
- "mapRoot": "",
27
26
  "declarationDir": "dist",
28
27
  "lib": ["dom", "ESNext"],
29
28
  "importsNotUsedAsValues": "error",
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
@@ -1,5 +0,0 @@
1
- import 'svelte';
2
- import * as _Sticky_Scroll from './Sticky_Scroll.svelte';
3
- export { _Sticky_Scroll as Sticky_Scroll };
4
-
5
- //# sourceMappingURL=index.js.map
@@ -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
@@ -1,2 +0,0 @@
1
- import 'svelte'
2
- export * as Sticky_Scroll from './Sticky_Scroll.svelte'