@linear_non/stellar-kit 1.1.7 → 1.1.9

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.
@@ -47,7 +47,6 @@ export default class ImageLoader {
47
47
 
48
48
  // cache-aware filter
49
49
  const toLoad = this.cache ? urls.filter(u => !this.cache.has(u)) : urls
50
-
51
50
  this.total = urls.length
52
51
  this.loaded = this.total - toLoad.length // count already-cached as loaded
53
52
 
package/events/Raf.js CHANGED
@@ -106,16 +106,31 @@ export default class Raf {
106
106
  })
107
107
  }
108
108
 
109
+ stop = () => {
110
+ gsap.ticker.remove(this.tick)
111
+ }
112
+
113
+ resume = () => {
114
+ this.scroll.current = this.scroll.target
115
+ this.scroll.rounded = this.scroll.target
116
+ gsap.ticker.add(this.tick)
117
+ ScrollTrigger.update()
118
+ }
119
+
109
120
  on() {
110
121
  gsap.ticker.add(this.tick)
111
122
  emitter.on(EVENTS.APP_SCROLL, this.onScroll)
112
123
  emitter.on(EVENTS.APP_MOUSEMOVE, this.onMouseMove)
124
+ window.addEventListener("pagehide", () => this.stop)
125
+ window.addEventListener("pageshow", () => this.resume)
113
126
  }
114
127
 
115
128
  off() {
116
129
  gsap.ticker.remove(this.tick)
117
130
  emitter.off(EVENTS.APP_SCROLL, this.onScroll)
118
131
  emitter.off(EVENTS.APP_MOUSEMOVE, this.onMouseMove)
132
+ window.removeEventListener("pagehide", () => this.stop)
133
+ window.removeEventListener("pageshow", () => this.resume)
119
134
  }
120
135
 
121
136
  destroy() {
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@linear_non/stellar-kit",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Stellar frontend core for Non-Linear Studio projects.",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
8
8
  "./utils": "./utils/index.js",
9
9
  "./classes": "./classes/index.js",
10
- "./workers": "./workers/*",
11
10
  "./events": "./events/index.js",
12
11
  "./gsap": "./libraries/gsap/index.js"
13
12
  },
@@ -23,7 +22,6 @@
23
22
  "utils/",
24
23
  "libraries/",
25
24
  "libraries/gsap/",
26
- "workers/",
27
25
  "kitStore.js",
28
26
  "index.js"
29
27
  ],
@@ -1,10 +0,0 @@
1
- self.addEventListener("message", async e => {
2
- const { url, index } = e.data
3
- try {
4
- const res = await fetch(url)
5
- const blob = await res.blob()
6
- self.postMessage({ url, blob, index })
7
- } catch (err) {
8
- console.error("Image worker error:", err)
9
- }
10
- })