@configura/babylon-view 2.0.0-alpha.0 → 2.0.0-alpha.3

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.
Files changed (134) hide show
  1. package/.eslintrc.json +18 -18
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/animation/AnimatableObject.d.ts +8 -8
  5. package/dist/animation/AnimatableObject.js +3 -3
  6. package/dist/animation/animator/Animator.d.ts +33 -33
  7. package/dist/animation/animator/Animator.js +58 -58
  8. package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
  9. package/dist/animation/animator/AnimatorEasing.js +31 -31
  10. package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
  11. package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
  12. package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
  13. package/dist/animation/animator/AnimatorHighlight.js +32 -32
  14. package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
  15. package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
  16. package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
  17. package/dist/animation/animator/AnimatorQueue.js +57 -57
  18. package/dist/animation/animator/AnimatorScale.d.ts +8 -8
  19. package/dist/animation/animator/AnimatorScale.js +13 -13
  20. package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
  21. package/dist/animation/animator/AnimatorSpin.js +13 -13
  22. package/dist/animation/animator/EasingFunctions.d.ts +35 -35
  23. package/dist/animation/animator/EasingFunctions.js +137 -137
  24. package/dist/animation/coordinator/Coordinator.d.ts +28 -28
  25. package/dist/animation/coordinator/Coordinator.js +53 -53
  26. package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
  27. package/dist/animation/coordinator/CoordinatorDropAndSpin.js +138 -138
  28. package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
  29. package/dist/animation/coordinator/CoordinatorIdentity.js +14 -14
  30. package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
  31. package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
  32. package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
  33. package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
  34. package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
  35. package/dist/animation/coordinator/CoordinatorPulseBounce.js +35 -35
  36. package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
  37. package/dist/animation/coordinator/CoordinatorPulseHighlight.js +29 -29
  38. package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
  39. package/dist/animation/coordinator/CoordinatorPulseInflate.js +23 -23
  40. package/dist/camera/CameraCreator.d.ts +5 -5
  41. package/dist/camera/CameraCreator.js +4 -4
  42. package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -26
  43. package/dist/camera/CfgArcRotateCameraPointersInput.js +266 -266
  44. package/dist/camera/CfgOrbitalCamera.d.ts +73 -73
  45. package/dist/camera/CfgOrbitalCamera.js +260 -260
  46. package/dist/camera/CfgOrbitalCameraControlProps.d.ts +11 -11
  47. package/dist/camera/CfgOrbitalCameraControlProps.js +6 -6
  48. package/dist/camera/GradingApplier.d.ts +3 -3
  49. package/dist/camera/GradingApplier.js +48 -48
  50. package/dist/engine/EngineCreator.d.ts +3 -3
  51. package/dist/engine/EngineCreator.js +10 -10
  52. package/dist/geometry/CfgGeometry.d.ts +29 -29
  53. package/dist/geometry/CfgGeometry.js +146 -146
  54. package/dist/geometry/CfgMesh.d.ts +10 -10
  55. package/dist/geometry/CfgMesh.js +38 -38
  56. package/dist/geometry/geoSplitter.d.ts +8 -8
  57. package/dist/geometry/geoSplitter.js +192 -192
  58. package/dist/geometry/stretch/CfgMorphTarget.d.ts +15 -15
  59. package/dist/geometry/stretch/CfgMorphTarget.js +65 -65
  60. package/dist/geometry/stretch/CfgStretchData.d.ts +116 -116
  61. package/dist/geometry/stretch/CfgStretchData.js +350 -350
  62. package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +16 -16
  63. package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -95
  64. package/dist/index.d.ts +16 -16
  65. package/dist/index.js +16 -16
  66. package/dist/io/CfgHistoryToCameraConfConnector.d.ts +29 -29
  67. package/dist/io/CfgHistoryToCameraConfConnector.js +80 -80
  68. package/dist/io/CfgIOCameraConfConnector.d.ts +35 -35
  69. package/dist/io/CfgIOCameraConfConnector.js +82 -82
  70. package/dist/io/CfgObservableStateToCameraConfConnector.d.ts +10 -10
  71. package/dist/io/CfgObservableStateToCameraConfConnector.js +11 -11
  72. package/dist/io/CfgWindowMessageToCameraConfConnector.d.ts +10 -10
  73. package/dist/io/CfgWindowMessageToCameraConfConnector.js +11 -11
  74. package/dist/light/CfgDirectionalLight.d.ts +8 -8
  75. package/dist/light/CfgDirectionalLight.js +18 -18
  76. package/dist/light/CfgHemisphericLight.d.ts +7 -7
  77. package/dist/light/CfgHemisphericLight.js +17 -17
  78. package/dist/light/CfgPointLight.d.ts +8 -8
  79. package/dist/light/CfgPointLight.js +18 -18
  80. package/dist/light/DefaultLightRig.d.ts +19 -19
  81. package/dist/light/DefaultLightRig.js +77 -77
  82. package/dist/light/LightRigCreator.d.ts +9 -9
  83. package/dist/light/LightRigCreator.js +3 -3
  84. package/dist/material/CfgMaterial.d.ts +68 -68
  85. package/dist/material/CfgMaterial.js +482 -482
  86. package/dist/material/DummyMaterialCreator.d.ts +4 -4
  87. package/dist/material/DummyMaterialCreator.js +15 -15
  88. package/dist/material/material.d.ts +18 -18
  89. package/dist/material/material.js +128 -128
  90. package/dist/material/texture.d.ts +14 -14
  91. package/dist/material/texture.js +306 -306
  92. package/dist/nodes/CfgContentRootNode.d.ts +19 -19
  93. package/dist/nodes/CfgContentRootNode.js +75 -75
  94. package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -55
  95. package/dist/nodes/CfgDeferredMeshNode.js +378 -378
  96. package/dist/nodes/CfgProductNode.d.ts +127 -127
  97. package/dist/nodes/CfgProductNode.js +598 -598
  98. package/dist/nodes/CfgSymNode.d.ts +50 -50
  99. package/dist/nodes/CfgSymNode.js +249 -249
  100. package/dist/nodes/CfgSymRootNode.d.ts +45 -45
  101. package/dist/nodes/CfgSymRootNode.js +229 -229
  102. package/dist/nodes/CfgTransformNode.d.ts +33 -33
  103. package/dist/nodes/CfgTransformNode.js +83 -83
  104. package/dist/scene/SceneCreator.d.ts +6 -6
  105. package/dist/scene/SceneCreator.js +22 -22
  106. package/dist/utilities/CfgBoundingBox.d.ts +21 -21
  107. package/dist/utilities/CfgBoundingBox.js +81 -81
  108. package/dist/utilities/anchor/anchor.d.ts +50 -50
  109. package/dist/utilities/anchor/anchor.js +133 -133
  110. package/dist/utilities/anchor/anchorMap.d.ts +20 -20
  111. package/dist/utilities/anchor/anchorMap.js +111 -111
  112. package/dist/utilities/utilities3D.d.ts +70 -70
  113. package/dist/utilities/utilities3D.js +265 -265
  114. package/dist/utilities/utilitiesColor.d.ts +18 -18
  115. package/dist/utilities/utilitiesColor.js +50 -50
  116. package/dist/utilities/utilitiesImage.d.ts +6 -6
  117. package/dist/utilities/utilitiesImage.js +107 -107
  118. package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -7
  119. package/dist/utilities/utilitiesSymRootIdentifier.js +26 -26
  120. package/dist/view/BaseView.d.ts +78 -78
  121. package/dist/view/BaseView.js +303 -303
  122. package/dist/view/BaseViewConfiguration.d.ts +32 -32
  123. package/dist/view/BaseViewConfiguration.js +10 -10
  124. package/dist/view/RenderEnv.d.ts +43 -43
  125. package/dist/view/RenderEnv.js +7 -7
  126. package/dist/view/SingleProductDefaultCameraView.d.ts +37 -37
  127. package/dist/view/SingleProductDefaultCameraView.js +145 -145
  128. package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +42 -42
  129. package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
  130. package/dist/view/SingleProductView.d.ts +44 -44
  131. package/dist/view/SingleProductView.js +212 -212
  132. package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
  133. package/dist/view/SingleProductViewConfiguration.js +19 -19
  134. package/package.json +5 -5
@@ -1,13 +1,13 @@
1
- import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
2
- import { AnimatorEasingMatrix, getDefaultConfig as baseGetDefaultConfig, } from "./AnimatorEasingMatrix.js";
3
- const defaultConfig = Object.assign(Object.assign({}, baseGetDefaultConfig(0)), { rotationAxis: new Vector3(0, 0, 1) });
4
- export class AnimatorSpin extends AnimatorEasingMatrix {
5
- constructor(node, config, type) {
6
- super(node, Object.assign(Object.assign({}, defaultConfig), config), type);
7
- }
8
- getTransformMatrix(boundedEased) {
9
- const spin = this._config.startPosition +
10
- (this._config.endPosition - this._config.startPosition) * boundedEased;
11
- return Matrix.RotationAxis(this._config.rotationAxis, spin);
12
- }
13
- }
1
+ import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
2
+ import { AnimatorEasingMatrix, getDefaultConfig as baseGetDefaultConfig, } from "./AnimatorEasingMatrix.js";
3
+ const defaultConfig = Object.assign(Object.assign({}, baseGetDefaultConfig(0)), { rotationAxis: new Vector3(0, 0, 1) });
4
+ export class AnimatorSpin extends AnimatorEasingMatrix {
5
+ constructor(node, config, type) {
6
+ super(node, Object.assign(Object.assign({}, defaultConfig), config), type);
7
+ }
8
+ getTransformMatrix(boundedEased) {
9
+ const spin = this._config.startPosition +
10
+ (this._config.endPosition - this._config.startPosition) * boundedEased;
11
+ return Matrix.RotationAxis(this._config.rotationAxis, spin);
12
+ }
13
+ }
@@ -1,36 +1,36 @@
1
- export declare type EasingFunction = (t: number) => number;
2
- export declare const EasingFunctions: {
3
- linear: EasingFunction;
4
- easeInQuad: EasingFunction;
5
- easeOutQuad: EasingFunction;
6
- easeInOutQuad: EasingFunction;
7
- easeInCubic: EasingFunction;
8
- easeOutCubic: EasingFunction;
9
- easeInOutCubic: EasingFunction;
10
- easeInQuart: EasingFunction;
11
- easeOutQuart: EasingFunction;
12
- easeInOutQuart: EasingFunction;
13
- easeInQuint: EasingFunction;
14
- easeOutQuint: EasingFunction;
15
- easeInOutQuint: EasingFunction;
16
- sinBounce: (oscillations: number) => EasingFunction;
17
- easeInSine: EasingFunction;
18
- easeOutSine: EasingFunction;
19
- easeInOutSine: EasingFunction;
20
- easeInExpo: EasingFunction;
21
- easeOutExpo: EasingFunction;
22
- easeInOutExpo: EasingFunction;
23
- easeInCirc: EasingFunction;
24
- easeOutCirc: EasingFunction;
25
- easeInOutCirc: EasingFunction;
26
- easeInElastic: EasingFunction;
27
- easeOutElastic: EasingFunction;
28
- easeInOutElastic: EasingFunction;
29
- easeInBack: (s?: number) => EasingFunction;
30
- easeOutBack: (s?: number) => EasingFunction;
31
- easeInOutBack: (s?: number) => EasingFunction;
32
- easeOutBounce: EasingFunction;
33
- makeMirrored: (func: EasingFunction) => EasingFunction;
34
- invert: (func: EasingFunction) => EasingFunction;
35
- };
1
+ export declare type EasingFunction = (t: number) => number;
2
+ export declare const EasingFunctions: {
3
+ linear: EasingFunction;
4
+ easeInQuad: EasingFunction;
5
+ easeOutQuad: EasingFunction;
6
+ easeInOutQuad: EasingFunction;
7
+ easeInCubic: EasingFunction;
8
+ easeOutCubic: EasingFunction;
9
+ easeInOutCubic: EasingFunction;
10
+ easeInQuart: EasingFunction;
11
+ easeOutQuart: EasingFunction;
12
+ easeInOutQuart: EasingFunction;
13
+ easeInQuint: EasingFunction;
14
+ easeOutQuint: EasingFunction;
15
+ easeInOutQuint: EasingFunction;
16
+ sinBounce: (oscillations: number) => EasingFunction;
17
+ easeInSine: EasingFunction;
18
+ easeOutSine: EasingFunction;
19
+ easeInOutSine: EasingFunction;
20
+ easeInExpo: EasingFunction;
21
+ easeOutExpo: EasingFunction;
22
+ easeInOutExpo: EasingFunction;
23
+ easeInCirc: EasingFunction;
24
+ easeOutCirc: EasingFunction;
25
+ easeInOutCirc: EasingFunction;
26
+ easeInElastic: EasingFunction;
27
+ easeOutElastic: EasingFunction;
28
+ easeInOutElastic: EasingFunction;
29
+ easeInBack: (s?: number) => EasingFunction;
30
+ easeOutBack: (s?: number) => EasingFunction;
31
+ easeInOutBack: (s?: number) => EasingFunction;
32
+ easeOutBounce: EasingFunction;
33
+ makeMirrored: (func: EasingFunction) => EasingFunction;
34
+ invert: (func: EasingFunction) => EasingFunction;
35
+ };
36
36
  //# sourceMappingURL=EasingFunctions.d.ts.map
@@ -1,137 +1,137 @@
1
- export const EasingFunctions = {
2
- // no easing, no acceleration
3
- linear: ((t) => t),
4
- // accelerating from zero velocity
5
- easeInQuad: ((t) => t * t),
6
- // decelerating to zero velocity
7
- easeOutQuad: ((t) => t * (2 - t)),
8
- // acceleration until halfway, then deceleration
9
- easeInOutQuad: ((t) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t)),
10
- // accelerating from zero velocity
11
- easeInCubic: ((t) => t * t * t),
12
- // decelerating to zero velocity
13
- easeOutCubic: ((t) => --t * t * t + 1),
14
- // acceleration until halfway, then deceleration
15
- easeInOutCubic: ((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),
16
- // accelerating from zero velocity
17
- easeInQuart: ((t) => t * t * t * t),
18
- // decelerating to zero velocity
19
- easeOutQuart: ((t) => 1 - --t * t * t * t),
20
- // acceleration until halfway, then deceleration
21
- easeInOutQuart: ((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t),
22
- // accelerating from zero velocity
23
- easeInQuint: ((t) => t * t * t * t * t),
24
- // decelerating to zero velocity
25
- easeOutQuint: ((t) => 1 + --t * t * t * t * t),
26
- // acceleration until halfway, then deceleration
27
- easeInOutQuint: ((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t),
28
- sinBounce: (oscillations) => (t) => (1 - Math.cos(t * oscillations * Math.PI * 2)) / 2,
29
- easeInSine: ((t) => -Math.cos(t * (Math.PI / 2)) + 1),
30
- easeOutSine: ((t) => Math.sin(t * (Math.PI / 2))),
31
- easeInOutSine: ((t) => (-1 / 2) * (Math.cos(Math.PI * t) - 1)),
32
- easeInExpo: ((t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1)))),
33
- easeOutExpo: ((t) => (t === 1 ? 1 : -Math.pow(2, -10 * t) + 1)),
34
- easeInOutExpo: ((t) => {
35
- if (t === 0)
36
- return 0;
37
- if (t === 1)
38
- return 1;
39
- if ((t /= 1 / 2) < 1)
40
- return (1 / 2) * Math.pow(2, 10 * (t - 1));
41
- return (1 / 2) * (-Math.pow(2, -10 * --t) + 2);
42
- }),
43
- easeInCirc: ((t) => -(Math.sqrt(1 - t * t) - 1)),
44
- easeOutCirc: ((t) => Math.sqrt(1 - (t = t - 1) * t)),
45
- easeInOutCirc: ((t) => {
46
- if (t / 1 / 2 < 1)
47
- return (-1 / 2) * (Math.sqrt(1 - t * t) - 1);
48
- return (1 / 2) * (Math.sqrt(1 - (t -= 2) * t) + 1);
49
- }),
50
- easeInElastic: ((t) => {
51
- let s = 1.70158;
52
- let p = 0;
53
- let a = 1;
54
- if (t === 0)
55
- return 0;
56
- if (t === 1)
57
- return 1;
58
- if (!p)
59
- p = 0.3;
60
- if (a < Math.abs(1)) {
61
- a = 1;
62
- s = p / 4;
63
- }
64
- else {
65
- s = (p / (2 * Math.PI)) * Math.asin(1 / a);
66
- }
67
- return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p));
68
- }),
69
- easeOutElastic: ((t) => {
70
- let s = 1.70158;
71
- let p = 0;
72
- let a = 1;
73
- if (t === 0)
74
- return 0;
75
- if (t === 1)
76
- return 1;
77
- if (!p)
78
- p = 0.3;
79
- if (a < Math.abs(1)) {
80
- a = 1;
81
- s = p / 4;
82
- }
83
- else {
84
- s = (p / (2 * Math.PI)) * Math.asin(1 / a);
85
- }
86
- return a * Math.pow(2, -10 * t) * Math.sin(((t - s) * (2 * Math.PI)) / p) + 1;
87
- }),
88
- easeInOutElastic: ((t) => {
89
- let s = 1.70158;
90
- let p = 0;
91
- let a = 1;
92
- if (t === 0)
93
- return 0;
94
- if (t / 2 === 2)
95
- return 1;
96
- if (!p)
97
- p = 0.3 * 1.5;
98
- if (a < 1) {
99
- a = 1;
100
- s = p / 4;
101
- }
102
- else {
103
- s = (p / (2 * Math.PI)) * Math.asin(1 / a);
104
- }
105
- if (t < 1)
106
- return (-0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p)));
107
- return a * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p) * 0.5 + 1;
108
- }),
109
- easeInBack: (s = 1.70158) => (t) => t * t * ((s + 1) * t - s),
110
- easeOutBack: (s = 1.70158) => (t) => (t = t - 1) * t * ((s + 1) * t + s) + 1,
111
- easeInOutBack: (s = 1.70158) => (t) => {
112
- if ((t /= 1 / 2) < 1)
113
- return (1 / 2) * (t * t * (((s *= 1.525) + 1) * t - s));
114
- return (1 / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);
115
- },
116
- easeOutBounce: ((t) => {
117
- if (t < 1 / 2.75) {
118
- return 7.5625 * t * t;
119
- }
120
- else if (t < 2 / 2.75) {
121
- return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
122
- }
123
- else if (t < 2.5 / 2.75) {
124
- return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
125
- }
126
- else {
127
- return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
128
- }
129
- }),
130
- makeMirrored: (func) => (t) => {
131
- const perceivedT = (t < 0.5 ? t : 1 - t) * 2;
132
- return func(perceivedT);
133
- },
134
- invert: (func) => (t) => {
135
- return func(1 - t);
136
- },
137
- };
1
+ export const EasingFunctions = {
2
+ // no easing, no acceleration
3
+ linear: ((t) => t),
4
+ // accelerating from zero velocity
5
+ easeInQuad: ((t) => t * t),
6
+ // decelerating to zero velocity
7
+ easeOutQuad: ((t) => t * (2 - t)),
8
+ // acceleration until halfway, then deceleration
9
+ easeInOutQuad: ((t) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t)),
10
+ // accelerating from zero velocity
11
+ easeInCubic: ((t) => t * t * t),
12
+ // decelerating to zero velocity
13
+ easeOutCubic: ((t) => --t * t * t + 1),
14
+ // acceleration until halfway, then deceleration
15
+ easeInOutCubic: ((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),
16
+ // accelerating from zero velocity
17
+ easeInQuart: ((t) => t * t * t * t),
18
+ // decelerating to zero velocity
19
+ easeOutQuart: ((t) => 1 - --t * t * t * t),
20
+ // acceleration until halfway, then deceleration
21
+ easeInOutQuart: ((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t),
22
+ // accelerating from zero velocity
23
+ easeInQuint: ((t) => t * t * t * t * t),
24
+ // decelerating to zero velocity
25
+ easeOutQuint: ((t) => 1 + --t * t * t * t * t),
26
+ // acceleration until halfway, then deceleration
27
+ easeInOutQuint: ((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t),
28
+ sinBounce: (oscillations) => (t) => (1 - Math.cos(t * oscillations * Math.PI * 2)) / 2,
29
+ easeInSine: ((t) => -Math.cos(t * (Math.PI / 2)) + 1),
30
+ easeOutSine: ((t) => Math.sin(t * (Math.PI / 2))),
31
+ easeInOutSine: ((t) => (-1 / 2) * (Math.cos(Math.PI * t) - 1)),
32
+ easeInExpo: ((t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1)))),
33
+ easeOutExpo: ((t) => (t === 1 ? 1 : -Math.pow(2, -10 * t) + 1)),
34
+ easeInOutExpo: ((t) => {
35
+ if (t === 0)
36
+ return 0;
37
+ if (t === 1)
38
+ return 1;
39
+ if ((t /= 1 / 2) < 1)
40
+ return (1 / 2) * Math.pow(2, 10 * (t - 1));
41
+ return (1 / 2) * (-Math.pow(2, -10 * --t) + 2);
42
+ }),
43
+ easeInCirc: ((t) => -(Math.sqrt(1 - t * t) - 1)),
44
+ easeOutCirc: ((t) => Math.sqrt(1 - (t = t - 1) * t)),
45
+ easeInOutCirc: ((t) => {
46
+ if (t / 1 / 2 < 1)
47
+ return (-1 / 2) * (Math.sqrt(1 - t * t) - 1);
48
+ return (1 / 2) * (Math.sqrt(1 - (t -= 2) * t) + 1);
49
+ }),
50
+ easeInElastic: ((t) => {
51
+ let s = 1.70158;
52
+ let p = 0;
53
+ let a = 1;
54
+ if (t === 0)
55
+ return 0;
56
+ if (t === 1)
57
+ return 1;
58
+ if (!p)
59
+ p = 0.3;
60
+ if (a < Math.abs(1)) {
61
+ a = 1;
62
+ s = p / 4;
63
+ }
64
+ else {
65
+ s = (p / (2 * Math.PI)) * Math.asin(1 / a);
66
+ }
67
+ return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p));
68
+ }),
69
+ easeOutElastic: ((t) => {
70
+ let s = 1.70158;
71
+ let p = 0;
72
+ let a = 1;
73
+ if (t === 0)
74
+ return 0;
75
+ if (t === 1)
76
+ return 1;
77
+ if (!p)
78
+ p = 0.3;
79
+ if (a < Math.abs(1)) {
80
+ a = 1;
81
+ s = p / 4;
82
+ }
83
+ else {
84
+ s = (p / (2 * Math.PI)) * Math.asin(1 / a);
85
+ }
86
+ return a * Math.pow(2, -10 * t) * Math.sin(((t - s) * (2 * Math.PI)) / p) + 1;
87
+ }),
88
+ easeInOutElastic: ((t) => {
89
+ let s = 1.70158;
90
+ let p = 0;
91
+ let a = 1;
92
+ if (t === 0)
93
+ return 0;
94
+ if (t / 2 === 2)
95
+ return 1;
96
+ if (!p)
97
+ p = 0.3 * 1.5;
98
+ if (a < 1) {
99
+ a = 1;
100
+ s = p / 4;
101
+ }
102
+ else {
103
+ s = (p / (2 * Math.PI)) * Math.asin(1 / a);
104
+ }
105
+ if (t < 1)
106
+ return (-0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p)));
107
+ return a * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p) * 0.5 + 1;
108
+ }),
109
+ easeInBack: (s = 1.70158) => (t) => t * t * ((s + 1) * t - s),
110
+ easeOutBack: (s = 1.70158) => (t) => (t = t - 1) * t * ((s + 1) * t + s) + 1,
111
+ easeInOutBack: (s = 1.70158) => (t) => {
112
+ if ((t /= 1 / 2) < 1)
113
+ return (1 / 2) * (t * t * (((s *= 1.525) + 1) * t - s));
114
+ return (1 / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);
115
+ },
116
+ easeOutBounce: ((t) => {
117
+ if (t < 1 / 2.75) {
118
+ return 7.5625 * t * t;
119
+ }
120
+ else if (t < 2 / 2.75) {
121
+ return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
122
+ }
123
+ else if (t < 2.5 / 2.75) {
124
+ return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
125
+ }
126
+ else {
127
+ return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
128
+ }
129
+ }),
130
+ makeMirrored: (func) => (t) => {
131
+ const perceivedT = (t < 0.5 ? t : 1 - t) * 2;
132
+ return func(perceivedT);
133
+ },
134
+ invert: (func) => (t) => {
135
+ return func(1 - t);
136
+ },
137
+ };
@@ -1,29 +1,29 @@
1
- import { Observable } from "@configura/web-utilities";
2
- import { CfgDeferredMeshNode } from "../../nodes/CfgDeferredMeshNode.js";
3
- import { CfgProductNode } from "../../nodes/CfgProductNode.js";
4
- import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
5
- import { SingleProductView } from "../../view/SingleProductView.js";
6
- import { SingleProductViewPhaseEvent } from "../../view/SingleProductViewConfiguration.js";
7
- export declare type CoordinatorCreator = (view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>) => Coordinator;
8
- export declare type CoordinatorWithMeta = {
9
- coordinator: Coordinator;
10
- isNewProduct: boolean;
11
- };
12
- export declare type CoordinatorConfig = Record<string, unknown>;
13
- export declare const defaultConfig: CoordinatorConfig;
14
- export declare abstract class Coordinator<Config extends CoordinatorConfig = CoordinatorConfig> {
15
- protected view: SingleProductView;
16
- protected phaseObservable: Observable<SingleProductViewPhaseEvent>;
17
- protected _config: Config;
18
- constructor(view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>, _config: Config);
19
- private phaseListener;
20
- destroy(): void;
21
- protected productNode: CfgProductNode | undefined;
22
- protected setProduct(productNode: CfgProductNode): void;
23
- prepareForEnter(_node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
24
- prepareForExit(_node: CfgSymRootNode): Promise<void>;
25
- prepareForMaterialChange(_node: CfgDeferredMeshNode, _isNewProduct: boolean): Promise<void>;
26
- abstract willTick(now: number, delta: number): boolean;
27
- abstract tick(now: number, delta: number): void;
28
- }
1
+ import { Observable } from "@configura/web-utilities";
2
+ import { CfgDeferredMeshNode } from "../../nodes/CfgDeferredMeshNode.js";
3
+ import { CfgProductNode } from "../../nodes/CfgProductNode.js";
4
+ import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
5
+ import { SingleProductView } from "../../view/SingleProductView.js";
6
+ import { SingleProductViewPhaseEvent } from "../../view/SingleProductViewConfiguration.js";
7
+ export declare type CoordinatorCreator = (view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>) => Coordinator;
8
+ export declare type CoordinatorWithMeta = {
9
+ coordinator: Coordinator;
10
+ isNewProduct: boolean;
11
+ };
12
+ export declare type CoordinatorConfig = Record<string, unknown>;
13
+ export declare const defaultConfig: CoordinatorConfig;
14
+ export declare abstract class Coordinator<Config extends CoordinatorConfig = CoordinatorConfig> {
15
+ protected view: SingleProductView;
16
+ protected phaseObservable: Observable<SingleProductViewPhaseEvent>;
17
+ protected _config: Config;
18
+ constructor(view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>, _config: Config);
19
+ private phaseListener;
20
+ destroy(): void;
21
+ protected productNode: CfgProductNode | undefined;
22
+ protected setProduct(productNode: CfgProductNode): void;
23
+ prepareForEnter(_node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
24
+ prepareForExit(_node: CfgSymRootNode): Promise<void>;
25
+ prepareForMaterialChange(_node: CfgDeferredMeshNode, _isNewProduct: boolean): Promise<void>;
26
+ abstract willTick(now: number, delta: number): boolean;
27
+ abstract tick(now: number, delta: number): void;
28
+ }
29
29
  //# sourceMappingURL=Coordinator.d.ts.map
@@ -1,53 +1,53 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { SingleProductViewPhase, } from "../../view/SingleProductViewConfiguration.js";
11
- export const defaultConfig = {};
12
- export class Coordinator {
13
- constructor(view, phaseObservable, _config) {
14
- this.view = view;
15
- this.phaseObservable = phaseObservable;
16
- this._config = _config;
17
- this.phaseListener = (phase) => {
18
- const { previous, current } = phase;
19
- if (previous !== SingleProductViewPhase.AddNewProduct ||
20
- current === SingleProductViewPhase.Error ||
21
- current === SingleProductViewPhase.Aborted) {
22
- return;
23
- }
24
- const currentProductNode = this.view.currentProductNode;
25
- if (currentProductNode === undefined) {
26
- return;
27
- }
28
- this.setProduct(currentProductNode);
29
- };
30
- this.phaseObservable.listen(this.phaseListener);
31
- }
32
- destroy() {
33
- this.phaseObservable.stopListen(this.phaseListener);
34
- }
35
- setProduct(productNode) {
36
- this.productNode = productNode;
37
- }
38
- prepareForEnter(_node, _isNewProduct) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- // Do nothing
41
- });
42
- }
43
- prepareForExit(_node) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- // Do nothing
46
- });
47
- }
48
- prepareForMaterialChange(_node, _isNewProduct) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- // Do nothing
51
- });
52
- }
53
- }
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { SingleProductViewPhase, } from "../../view/SingleProductViewConfiguration.js";
11
+ export const defaultConfig = {};
12
+ export class Coordinator {
13
+ constructor(view, phaseObservable, _config) {
14
+ this.view = view;
15
+ this.phaseObservable = phaseObservable;
16
+ this._config = _config;
17
+ this.phaseListener = (phase) => {
18
+ const { previous, current } = phase;
19
+ if (previous !== SingleProductViewPhase.AddNewProduct ||
20
+ current === SingleProductViewPhase.Error ||
21
+ current === SingleProductViewPhase.Aborted) {
22
+ return;
23
+ }
24
+ const currentProductNode = this.view.currentProductNode;
25
+ if (currentProductNode === undefined) {
26
+ return;
27
+ }
28
+ this.setProduct(currentProductNode);
29
+ };
30
+ this.phaseObservable.listen(this.phaseListener);
31
+ }
32
+ destroy() {
33
+ this.phaseObservable.stopListen(this.phaseListener);
34
+ }
35
+ setProduct(productNode) {
36
+ this.productNode = productNode;
37
+ }
38
+ prepareForEnter(_node, _isNewProduct) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ // Do nothing
41
+ });
42
+ }
43
+ prepareForExit(_node) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ // Do nothing
46
+ });
47
+ }
48
+ prepareForMaterialChange(_node, _isNewProduct) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ // Do nothing
51
+ });
52
+ }
53
+ }
@@ -1,23 +1,23 @@
1
- import { CfgProductNode } from "../../nodes/CfgProductNode.js";
2
- import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
3
- import { CoordinatorCreator } from "./Coordinator.js";
4
- import { CoordinatorNodeQueues, CoordinatorNodeQueuesConfig } from "./CoordinatorNodeQueues.js";
5
- export declare type CoordinatorDropAndSpinConfig = CoordinatorNodeQueuesConfig & {
6
- distance: number;
7
- enterDuration: number;
8
- exitDuration: number;
9
- staggerDuration: number;
10
- spinDuration: number;
11
- };
12
- export declare const defaultConfig: CoordinatorDropAndSpinConfig;
13
- export declare class CoordinatorDropAndSpin extends CoordinatorNodeQueues<CoordinatorDropAndSpinConfig> {
14
- static getCoordinatorCreator(config?: Partial<CoordinatorDropAndSpinConfig>): CoordinatorCreator;
15
- private constructor();
16
- destroy(): void;
17
- private phaseListenerDropAndSpin;
18
- setProduct(productNode: CfgProductNode): void;
19
- prepareForEnter(node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
20
- prepareForExit(node: CfgSymRootNode): Promise<void>;
21
- private applyDelay;
22
- }
1
+ import { CfgProductNode } from "../../nodes/CfgProductNode.js";
2
+ import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
3
+ import { CoordinatorCreator } from "./Coordinator.js";
4
+ import { CoordinatorNodeQueues, CoordinatorNodeQueuesConfig } from "./CoordinatorNodeQueues.js";
5
+ export declare type CoordinatorDropAndSpinConfig = CoordinatorNodeQueuesConfig & {
6
+ distance: number;
7
+ enterDuration: number;
8
+ exitDuration: number;
9
+ staggerDuration: number;
10
+ spinDuration: number;
11
+ };
12
+ export declare const defaultConfig: CoordinatorDropAndSpinConfig;
13
+ export declare class CoordinatorDropAndSpin extends CoordinatorNodeQueues<CoordinatorDropAndSpinConfig> {
14
+ static getCoordinatorCreator(config?: Partial<CoordinatorDropAndSpinConfig>): CoordinatorCreator;
15
+ private constructor();
16
+ destroy(): void;
17
+ private phaseListenerDropAndSpin;
18
+ setProduct(productNode: CfgProductNode): void;
19
+ prepareForEnter(node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
20
+ prepareForExit(node: CfgSymRootNode): Promise<void>;
21
+ private applyDelay;
22
+ }
23
23
  //# sourceMappingURL=CoordinatorDropAndSpin.d.ts.map