svelte-intersection-observer 0.9.0 → 0.9.1
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 +12 -0
- package/README.md +10 -4
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +4 -4
- package/src/IntersectionObserver.svelte +1 -8
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.9.1](https://github.com/metonym/svelte-intersection-observer/releases/tag/v0.9.1) - 2021-10-25
|
|
9
|
+
|
|
10
|
+
**Documentation**
|
|
11
|
+
|
|
12
|
+
- update the "Once" example to include the `"svelte-intersection-observer"` import
|
|
13
|
+
- rename example `svite` to `vite`
|
|
14
|
+
|
|
15
|
+
**Refactoring**
|
|
16
|
+
|
|
17
|
+
- inline `entry` prop typedef
|
|
18
|
+
- remove `@event`, `@slot` artifacts used by sveld to generate initial TypeScript definitions
|
|
19
|
+
|
|
8
20
|
## [0.9.0](https://github.com/metonym/svelte-intersection-observer/releases/tag/v0.9.0) - 2021-10-05
|
|
9
21
|
|
|
10
22
|
- improve TypeScript definitions for dispatched events
|
package/README.md
CHANGED
|
@@ -55,7 +55,9 @@ Set `once` to `true` for the intersection event to occur only once. The `element
|
|
|
55
55
|
|
|
56
56
|
```svelte
|
|
57
57
|
<script>
|
|
58
|
-
|
|
58
|
+
import IntersectionObserver from "svelte-intersection-observer";
|
|
59
|
+
|
|
60
|
+
let elementOnce;
|
|
59
61
|
let intersectOnce;
|
|
60
62
|
</script>
|
|
61
63
|
|
|
@@ -63,8 +65,12 @@ Set `once` to `true` for the intersection event to occur only once. The `element
|
|
|
63
65
|
{intersectOnce ? "Element is in view" : "Element is not in view"}
|
|
64
66
|
</header>
|
|
65
67
|
|
|
66
|
-
<IntersectionObserver
|
|
67
|
-
|
|
68
|
+
<IntersectionObserver
|
|
69
|
+
once
|
|
70
|
+
element={elementOnce}
|
|
71
|
+
bind:intersecting={intersectOnce}
|
|
72
|
+
>
|
|
73
|
+
<div bind:this={elementOnce}>Hello world</div>
|
|
68
74
|
</IntersectionObserver>
|
|
69
75
|
```
|
|
70
76
|
|
|
@@ -176,7 +182,7 @@ interface IntersectionObserverEntry {
|
|
|
176
182
|
The [examples folder](examples/) contains sample set-ups.
|
|
177
183
|
|
|
178
184
|
- [examples/sveltekit](examples/sveltekit)
|
|
179
|
-
- [examples/
|
|
185
|
+
- [examples/vite](examples/vite)
|
|
180
186
|
- [examples/sapper](examples/sapper)
|
|
181
187
|
- [examples/snowpack](examples/snowpack)
|
|
182
188
|
- [examples/rollup](examples/rollup)
|
package/lib/index.js
CHANGED
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
/* src/IntersectionObserver.svelte generated by Svelte v3.
|
|
337
|
+
/* src/IntersectionObserver.svelte generated by Svelte v3.44.0 */
|
|
338
338
|
|
|
339
339
|
const get_default_slot_changes = dirty => ({
|
|
340
340
|
intersecting: dirty & /*intersecting*/ 2,
|
package/lib/index.mjs
CHANGED
|
@@ -328,7 +328,7 @@ class SvelteComponent {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
/* src/IntersectionObserver.svelte generated by Svelte v3.
|
|
331
|
+
/* src/IntersectionObserver.svelte generated by Svelte v3.44.0 */
|
|
332
332
|
|
|
333
333
|
const get_default_slot_changes = dirty => ({
|
|
334
334
|
intersecting: dirty & /*intersecting*/ 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-intersection-observer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Detect if an element is in the viewport using the Intersection Observer API",
|
|
6
6
|
"author": "Eric Liu (https://github.com/metonym)",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"prettier": "^2.4.1",
|
|
21
21
|
"prettier-plugin-svelte": "^2.4.0",
|
|
22
|
-
"svelte": "^3.
|
|
23
|
-
"svelte-check": "^2.2.
|
|
24
|
-
"svelte-readme": "^3.
|
|
22
|
+
"svelte": "^3.44.0",
|
|
23
|
+
"svelte-check": "^2.2.7",
|
|
24
|
+
"svelte-readme": "^3.4.1"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {null | IntersectionObserverEntry} Entry
|
|
4
|
-
* @event {Entry} observe
|
|
5
|
-
* @event {Entry} intersect
|
|
6
|
-
* @slot {{ intersecting: boolean; entry: Entry; observer: IntersectionObserver }}
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
2
|
/**
|
|
10
3
|
* The HTML Element to observe
|
|
11
4
|
* @type {null | HTMLElement}
|
|
@@ -34,7 +27,7 @@
|
|
|
34
27
|
*/
|
|
35
28
|
export let threshold = 0;
|
|
36
29
|
|
|
37
|
-
/** @type {null |
|
|
30
|
+
/** @type {null | IntersectionObserverEntry} */
|
|
38
31
|
export let entry = null;
|
|
39
32
|
|
|
40
33
|
/**
|