@quenty/blend 12.4.0-canary.490.601c967.0 → 12.5.0

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
@@ -3,7 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [12.4.0-canary.490.601c967.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.3.0...@quenty/blend@12.4.0-canary.490.601c967.0) (2024-08-27)
6
+ # [12.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.4.0...@quenty/blend@12.5.0) (2024-09-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Blend spring uses a default spring object, fixing any errors ([d468636](https://github.com/Quenty/NevermoreEngine/commit/d468636dc58f951fbfc565d4a6b68c79483e379a))
12
+ * Fix some spring object stuff ([34e8ede](https://github.com/Quenty/NevermoreEngine/commit/34e8edee97fa93a0a5bd84442b85826082444f2a))
7
13
 
8
14
 
9
15
  ### Features
@@ -14,6 +20,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
14
20
 
15
21
 
16
22
 
23
+ # [12.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.3.0...@quenty/blend@12.4.0) (2024-08-09)
24
+
25
+ **Note:** Version bump only for package @quenty/blend
26
+
27
+
28
+
29
+
30
+
17
31
  # [12.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.2.0...@quenty/blend@12.3.0) (2024-05-09)
18
32
 
19
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/blend",
3
- "version": "12.4.0-canary.490.601c967.0",
3
+ "version": "12.5.0",
4
4
  "description": "Declarative UI system.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,24 +27,24 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@quenty/acceltween": "2.5.0-canary.490.601c967.0",
31
- "@quenty/brio": "14.4.0-canary.490.601c967.0",
32
- "@quenty/ducktype": "5.4.0-canary.490.601c967.0",
33
- "@quenty/instanceutils": "13.4.0-canary.490.601c967.0",
34
- "@quenty/loader": "10.4.0-canary.490.601c967.0",
35
- "@quenty/maid": "3.2.0",
36
- "@quenty/promise": "10.4.0-canary.490.601c967.0",
37
- "@quenty/rx": "13.4.0-canary.490.601c967.0",
38
- "@quenty/signal": "7.4.0-canary.490.601c967.0",
39
- "@quenty/spring": "10.4.0-canary.490.601c967.0",
40
- "@quenty/steputils": "3.4.0",
41
- "@quenty/string": "3.2.0",
42
- "@quenty/valuebaseutils": "13.4.0-canary.490.601c967.0",
43
- "@quenty/valueobject": "13.4.0-canary.490.601c967.0"
30
+ "@quenty/acceltween": "^2.5.0",
31
+ "@quenty/brio": "^14.5.0",
32
+ "@quenty/ducktype": "^5.4.0",
33
+ "@quenty/instanceutils": "^13.5.0",
34
+ "@quenty/loader": "^10.4.0",
35
+ "@quenty/maid": "^3.3.0",
36
+ "@quenty/promise": "^10.4.0",
37
+ "@quenty/rx": "^13.5.0",
38
+ "@quenty/signal": "^7.4.0",
39
+ "@quenty/spring": "^10.4.0",
40
+ "@quenty/steputils": "^3.4.0",
41
+ "@quenty/string": "^3.2.0",
42
+ "@quenty/valuebaseutils": "^13.5.0",
43
+ "@quenty/valueobject": "^13.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@quenty/contentproviderutils": "12.4.0-canary.490.601c967.0",
47
- "@quenty/playerthumbnailutils": "10.4.0-canary.490.601c967.0"
46
+ "@quenty/contentproviderutils": "^12.5.0",
47
+ "@quenty/playerthumbnailutils": "^10.4.0"
48
48
  },
49
- "gitHead": "601c9671f09638be4f326e41fcfe3343ccfe76d8"
49
+ "gitHead": "fb172906f3ee725269ec1e5f4daf9dca227e729d"
50
50
  }
@@ -417,6 +417,7 @@ function Blend.Spring(source, speed, damper)
417
417
  local maid = Maid.new()
418
418
 
419
419
  local spring = maid:Add(SpringObject.new(source, speed, damper))
420
+ spring.Epsilon = 1e-3
420
421
 
421
422
  maid:GiveTask(spring:Observe():Subscribe(sub:GetFireFailComplete()))
422
423
 
@@ -45,9 +45,7 @@ function SpringObject.new(target, speed, damper)
45
45
  self._maid:GiveTask(self.Changed)
46
46
 
47
47
  if target then
48
- self.Target = target
49
- else
50
- self:_getSpringForType(0)
48
+ self:SetTarget(target)
51
49
  end
52
50
 
53
51
  if speed then
@@ -287,8 +285,17 @@ function SpringObject:__index(index)
287
285
  return self._epsilon
288
286
  elseif SpringObject[index] then
289
287
  return SpringObject[index]
288
+ elseif index == "_currentSpring" then
289
+ local found = rawget(self, "_currentSpring")
290
+ if found then
291
+ return found
292
+ end
293
+
294
+ -- Note that sometimes the current spring isn't loaded yet as a type so
295
+ -- we use a number for this.
296
+ return self:_getSpringForType(0)
290
297
  else
291
- error(("%q is not a member of SpringObject"):format(tostring(index)))
298
+ error(string.format("%q is not a member of SpringObject", tostring(index)))
292
299
  end
293
300
  end
294
301
 
@@ -323,6 +330,7 @@ function SpringObject:__newindex(index, value)
323
330
  end)
324
331
  elseif index == "Speed" or index == "s" then
325
332
  local observable = assert(Blend.toNumberObservable(value), "Invalid speed")
333
+ assert(self._currentSpring, "No self._currentSpring")
326
334
 
327
335
  self._maid._speedSub = observable:Subscribe(function(unconverted)
328
336
  assert(type(unconverted) == "number", "Bad damper")
@@ -337,16 +345,19 @@ function SpringObject:__newindex(index, value)
337
345
  assert(type(value) == "function", "Bad clock value")
338
346
  self._currentSpring.Clock = value
339
347
  self.Changed:Fire()
348
+ elseif index == "_currentSpring" then
349
+ rawset(self, "_currentSpring", value)
340
350
  else
341
- error(("%q is not a member of SpringObject"):format(tostring(index)))
351
+ error(string.format("%q is not a member of SpringObject", tostring(index)))
342
352
  end
343
353
  end
344
354
 
345
355
  function SpringObject:_getSpringForType(converted)
346
356
  if rawget(self, "_currentSpring") == nil then
347
357
  -- only happens on init
348
- rawset(self, "_currentSpring", Spring.new(converted))
349
- return self._currentSpring
358
+ local created = Spring.new(converted)
359
+ rawset(self, "_currentSpring", created)
360
+ return created
350
361
  else
351
362
  local currentType = typeof(SpringUtils.fromLinearIfNeeded(self._currentSpring.Value))
352
363
  if currentType == typeof(SpringUtils.fromLinearIfNeeded(converted)) then
@@ -356,11 +367,12 @@ function SpringObject:_getSpringForType(converted)
356
367
  local oldSpeed = self._currentSpring.s
357
368
  local clock = self._currentSpring.Clock
358
369
 
359
- self._currentSpring = Spring.new(converted)
360
- self._currentSpring.Clock = clock
361
- self._currentSpring.Speed = oldSpeed
362
- self._currentSpring.Damper = oldDamper
363
- return self._currentSpring
370
+ local newSpring = Spring.new(converted)
371
+ newSpring.Clock = clock
372
+ newSpring.Speed = oldSpeed
373
+ newSpring.Damper = oldDamper
374
+ rawset(self, "_currentSpring", newSpring)
375
+ return newSpring
364
376
  end
365
377
  end
366
378
  end