@mml-io/mml-web-client 0.0.0-experimental-59cdd31-20250226 → 0.0.0-experimental-23450b2-20250302

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/build/index.js CHANGED
@@ -2317,13 +2317,20 @@
2317
2317
  }
2318
2318
  return lerpHSL(previousValue, elementValue, ratio);
2319
2319
  }
2320
- getFloatValueForTime(windowTime, elementValueSetTime, elementValue, previousValue) {
2321
- const from = previousValue;
2320
+ getFloatValueForTime(windowTime, elementValueSetTime, elementValue, previousValue, isDegrees) {
2321
+ let from = previousValue;
2322
2322
  const to = elementValue;
2323
2323
  const ratio = this.getLerpRatio(windowTime, elementValueSetTime);
2324
2324
  if (ratio >= 1) {
2325
2325
  return to;
2326
2326
  }
2327
+ if (isDegrees) {
2328
+ if (to - from > 180) {
2329
+ from += 360;
2330
+ } else if (from - to > 180) {
2331
+ from -= 360;
2332
+ }
2333
+ }
2327
2334
  return from + (to - from) * ratio;
2328
2335
  }
2329
2336
  getLerpRatio(windowTime, elementValueSetTime) {
@@ -2381,6 +2388,9 @@
2381
2388
  }
2382
2389
  }
2383
2390
  function isColorAttribute(attributeState) {
2391
+ return attributeState.type === 2;
2392
+ }
2393
+ function isDegreesAttribute(attributeState) {
2384
2394
  return attributeState.type === 1;
2385
2395
  }
2386
2396
  function isNumberAttribute(attributeState) {
@@ -2539,7 +2549,7 @@
2539
2549
  let stale = null;
2540
2550
  const state = this.stateByAttribute[key];
2541
2551
  for (const animation of state.animationsInOrder) {
2542
- const [newValue, active] = state.attributeState.type === 1 ? animation.getColorValueForTime(documentTime) : animation.getFloatValueForTime(documentTime);
2552
+ const [newValue, active] = state.attributeState.type === 2 ? animation.getColorValueForTime(documentTime) : animation.getFloatValueForTime(documentTime);
2543
2553
  if (active === 0) {
2544
2554
  updateIfChangedValue(state, newValue);
2545
2555
  stale = null;
@@ -2575,6 +2585,17 @@
2575
2585
  config.previousValue
2576
2586
  )
2577
2587
  );
2588
+ } else if (isDegreesAttribute(config)) {
2589
+ updateIfChangedValue(
2590
+ state,
2591
+ lerp2.getFloatValueForTime(
2592
+ this.element.getWindowTime(),
2593
+ config.elementValueSetTime,
2594
+ config.elementValue,
2595
+ config.previousValue,
2596
+ true
2597
+ )
2598
+ );
2578
2599
  } else if (isNumberAttribute(config)) {
2579
2600
  updateIfChangedValue(
2580
2601
  state,
@@ -2582,7 +2603,8 @@
2582
2603
  this.element.getWindowTime(),
2583
2604
  config.elementValueSetTime,
2584
2605
  config.elementValue,
2585
- config.previousValue
2606
+ config.previousValue,
2607
+ false
2586
2608
  )
2587
2609
  );
2588
2610
  }
@@ -3594,7 +3616,7 @@
3594
3616
  }
3595
3617
  ],
3596
3618
  rx: [
3597
- 0,
3619
+ 1,
3598
3620
  0,
3599
3621
  (newValue) => {
3600
3622
  var _a2;
@@ -3604,7 +3626,7 @@
3604
3626
  }
3605
3627
  ],
3606
3628
  ry: [
3607
- 0,
3629
+ 1,
3608
3630
  0,
3609
3631
  (newValue) => {
3610
3632
  var _a2;
@@ -3614,7 +3636,7 @@
3614
3636
  }
3615
3637
  ],
3616
3638
  rz: [
3617
- 0,
3639
+ 1,
3618
3640
  0,
3619
3641
  (newValue) => {
3620
3642
  var _a2;
@@ -4476,7 +4498,7 @@
4476
4498
  };
4477
4499
  this.cubeAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
4478
4500
  color: [
4479
- 1,
4501
+ 2,
4480
4502
  defaultCubeColor,
4481
4503
  (newValue) => {
4482
4504
  var _a2;
@@ -4655,7 +4677,7 @@
4655
4677
  };
4656
4678
  this.cylinderAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
4657
4679
  color: [
4658
- 1,
4680
+ 2,
4659
4681
  defaultCylinderColor,
4660
4682
  (newValue) => {
4661
4683
  var _a2;
@@ -6026,7 +6048,7 @@
6026
6048
  this.collideableHelper = new CollideableHelper(this);
6027
6049
  this.labelAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
6028
6050
  color: [
6029
- 1,
6051
+ 2,
6030
6052
  defaultLabelColor,
6031
6053
  (newValue) => {
6032
6054
  var _a2;
@@ -6035,7 +6057,7 @@
6035
6057
  }
6036
6058
  ],
6037
6059
  "font-color": [
6038
- 1,
6060
+ 2,
6039
6061
  defaultFontColor,
6040
6062
  (newValue) => {
6041
6063
  var _a2;
@@ -6238,7 +6260,7 @@
6238
6260
  super();
6239
6261
  this.lightAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
6240
6262
  color: [
6241
- 1,
6263
+ 2,
6242
6264
  defaultLightColor,
6243
6265
  (newValue) => {
6244
6266
  var _a2;
@@ -6511,7 +6533,7 @@
6511
6533
  };
6512
6534
  this.planeAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
6513
6535
  color: [
6514
- 1,
6536
+ 2,
6515
6537
  defaultPlaneColor,
6516
6538
  (newValue) => {
6517
6539
  var _a2;
@@ -7093,7 +7115,7 @@
7093
7115
  };
7094
7116
  this.sphereAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
7095
7117
  color: [
7096
- 1,
7118
+ 2,
7097
7119
  defaultSphereColor,
7098
7120
  (newValue) => {
7099
7121
  var _a2;