@linear_non/stellar-libs 1.0.33 → 1.0.35

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.33",
3
+ "version": "1.0.35",
4
4
  "description": "Reusable JavaScript libraries for Non-Linear Studio projects.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { EVENTS } from "@linear_non/stellar-kit/events"
2
- import { Observer, splitText } from "@linear_non/stellar-kit/plugins"
2
+ import { Observer, reverseSplit, splitText } from "@linear_non/stellar-kit/plugins"
3
3
 
4
4
  export default class SplitonScroll {
5
5
  constructor({
@@ -31,24 +31,7 @@ export default class SplitonScroll {
31
31
  // Grouped SplitText() instances from data-split-group
32
32
  this.groups = null
33
33
 
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
-
34
+ this.isReadyCallback = isReady || (() => {})
52
35
  this.reverseCallback = reverse || (() => {})
53
36
  this.start = start
54
37
  this.end = end
@@ -63,16 +46,12 @@ export default class SplitonScroll {
63
46
 
64
47
  // If no element or no targets, resolve immediately
65
48
  if (!this.element || !this.targets.length) {
66
- const splits = []
67
- const groups = {}
68
- const payload = { splits, groups }
69
-
49
+ const payload = { splits: [], groups: {} }
70
50
  if (this._resolveReady) {
71
51
  this._resolveReady(payload)
72
52
  this._resolveReady = null
73
53
  }
74
-
75
- this.isReadyCallback(splits, groups)
54
+ this.isReadyCallback([], {})
76
55
  return
77
56
  }
78
57