@linear_non/stellar-libs 1.0.32 → 1.0.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linear_non/stellar-libs",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Reusable JavaScript libraries for Non-Linear Studio projects.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,9 +1,6 @@
1
- import { EVENTS } from "@linear_non/stellar-kit/events"
2
- import { Observer, splitText } from "@linear_non/stellar-kit/plugins"
3
-
4
1
  export default class SplitonScroll {
5
2
  constructor({
6
- trigger: el,
3
+ el,
7
4
  splitText,
8
5
  isReady,
9
6
  reverse,
@@ -31,24 +28,7 @@ export default class SplitonScroll {
31
28
  // Grouped SplitText() instances from data-split-group
32
29
  this.groups = null
33
30
 
34
- // Backward-compatible isReady wrapper
35
- // isReady(splits) OR isReady(splits, groups) OR isReady({ splits, groups })
36
- this._userReady = typeof isReady === "function" ? isReady : null
37
- this.isReadyCallback = (splits, groups) => {
38
- if (!this._userReady) return
39
-
40
- if (this._userReady.length === 0) {
41
- // If callback expects 0 args, give it the object
42
- this._userReady({ splits, groups })
43
- } else if (this._userReady.length === 1) {
44
- // If callback expects 1 arg, assume old-style: isReady(splits)
45
- this._userReady(splits)
46
- } else {
47
- // 2+ args: new-style: isReady(splits, groups)
48
- this._userReady(splits, groups)
49
- }
50
- }
51
-
31
+ this.isReadyCallback = isReady || (() => {})
52
32
  this.reverseCallback = reverse || (() => {})
53
33
  this.start = start
54
34
  this.end = end
@@ -63,16 +43,12 @@ export default class SplitonScroll {
63
43
 
64
44
  // If no element or no targets, resolve immediately
65
45
  if (!this.element || !this.targets.length) {
66
- const splits = []
67
- const groups = {}
68
- const payload = { splits, groups }
69
-
46
+ const payload = { splits: [], groups: {} }
70
47
  if (this._resolveReady) {
71
48
  this._resolveReady(payload)
72
49
  this._resolveReady = null
73
50
  }
74
-
75
- this.isReadyCallback(splits, groups)
51
+ this.isReadyCallback([], {})
76
52
  return
77
53
  }
78
54