@configura/babylon-view 1.3.0-alpha.3 → 1.3.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.
Files changed (125) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/animation/AnimatableObject.d.ts +8 -8
  4. package/dist/animation/AnimatableObject.js +3 -3
  5. package/dist/animation/animator/Animator.d.ts +33 -33
  6. package/dist/animation/animator/Animator.js +58 -58
  7. package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
  8. package/dist/animation/animator/AnimatorEasing.js +31 -31
  9. package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
  10. package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
  11. package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
  12. package/dist/animation/animator/AnimatorHighlight.js +32 -32
  13. package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
  14. package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
  15. package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
  16. package/dist/animation/animator/AnimatorQueue.js +57 -57
  17. package/dist/animation/animator/AnimatorScale.d.ts +8 -8
  18. package/dist/animation/animator/AnimatorScale.js +13 -13
  19. package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
  20. package/dist/animation/animator/AnimatorSpin.js +13 -13
  21. package/dist/animation/animator/EasingFunctions.d.ts +35 -35
  22. package/dist/animation/animator/EasingFunctions.js +137 -137
  23. package/dist/animation/coordinator/Coordinator.d.ts +28 -28
  24. package/dist/animation/coordinator/Coordinator.js +47 -47
  25. package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
  26. package/dist/animation/coordinator/CoordinatorDropAndSpin.js +133 -133
  27. package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
  28. package/dist/animation/coordinator/CoordinatorIdentity.js +12 -12
  29. package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
  30. package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
  31. package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
  32. package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
  33. package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
  34. package/dist/animation/coordinator/CoordinatorPulseBounce.js +40 -40
  35. package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
  36. package/dist/animation/coordinator/CoordinatorPulseHighlight.js +34 -34
  37. package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
  38. package/dist/animation/coordinator/CoordinatorPulseInflate.js +30 -30
  39. package/dist/camera/CameraCreator.d.ts +5 -5
  40. package/dist/camera/CameraCreator.js +4 -4
  41. package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -10
  42. package/dist/camera/CfgArcRotateCameraPointersInput.js +264 -262
  43. package/dist/camera/CfgOrbitalCamera.d.ts +68 -68
  44. package/dist/camera/CfgOrbitalCamera.js +250 -250
  45. package/dist/camera/CfgOrbitalCameraControlProps.d.ts +6 -6
  46. package/dist/camera/CfgOrbitalCameraControlProps.js +3 -3
  47. package/dist/camera/GradingApplier.d.ts +3 -3
  48. package/dist/camera/GradingApplier.js +48 -48
  49. package/dist/engine/EngineCreator.d.ts +3 -3
  50. package/dist/engine/EngineCreator.js +10 -10
  51. package/dist/geometry/CfgGeometry.d.ts +29 -12
  52. package/dist/geometry/CfgGeometry.js +146 -117
  53. package/dist/geometry/CfgMesh.d.ts +10 -7
  54. package/dist/geometry/CfgMesh.js +38 -8
  55. package/dist/geometry/geoSplitter.d.ts +8 -8
  56. package/dist/geometry/geoSplitter.js +192 -192
  57. package/dist/geometry/stretch/CfgMorphTarget.d.ts +16 -0
  58. package/dist/geometry/stretch/CfgMorphTarget.js +65 -0
  59. package/dist/geometry/stretch/CfgStretchData.d.ts +115 -0
  60. package/dist/geometry/stretch/CfgStretchData.js +340 -0
  61. package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +17 -0
  62. package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -0
  63. package/dist/index.d.ts +13 -13
  64. package/dist/index.js +13 -13
  65. package/dist/light/CfgDirectionalLight.d.ts +8 -8
  66. package/dist/light/CfgDirectionalLight.js +18 -18
  67. package/dist/light/CfgHemisphericLight.d.ts +7 -7
  68. package/dist/light/CfgHemisphericLight.js +17 -17
  69. package/dist/light/CfgPointLight.d.ts +8 -8
  70. package/dist/light/CfgPointLight.js +18 -18
  71. package/dist/light/DefaultLightRig.d.ts +19 -19
  72. package/dist/light/DefaultLightRig.js +77 -77
  73. package/dist/light/LightRigCreator.d.ts +9 -9
  74. package/dist/light/LightRigCreator.js +3 -3
  75. package/dist/material/CfgMaterial.d.ts +68 -53
  76. package/dist/material/CfgMaterial.js +482 -454
  77. package/dist/material/DummyMaterialCreator.d.ts +4 -4
  78. package/dist/material/DummyMaterialCreator.js +15 -15
  79. package/dist/material/material.d.ts +18 -18
  80. package/dist/material/material.js +128 -128
  81. package/dist/material/texture.d.ts +14 -14
  82. package/dist/material/texture.js +306 -304
  83. package/dist/nodes/CfgContentRootNode.d.ts +19 -19
  84. package/dist/nodes/CfgContentRootNode.js +75 -75
  85. package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -48
  86. package/dist/nodes/CfgDeferredMeshNode.js +377 -347
  87. package/dist/nodes/CfgProductNode.d.ts +126 -61
  88. package/dist/nodes/CfgProductNode.js +578 -486
  89. package/dist/nodes/CfgSymNode.d.ts +50 -42
  90. package/dist/nodes/CfgSymNode.js +249 -216
  91. package/dist/nodes/CfgSymRootNode.d.ts +45 -33
  92. package/dist/nodes/CfgSymRootNode.js +220 -175
  93. package/dist/nodes/CfgTransformNode.d.ts +33 -29
  94. package/dist/nodes/CfgTransformNode.js +83 -81
  95. package/dist/scene/SceneCreator.d.ts +6 -6
  96. package/dist/scene/SceneCreator.js +22 -22
  97. package/dist/utilities/CfgBoundingBox.d.ts +21 -16
  98. package/dist/utilities/CfgBoundingBox.js +81 -64
  99. package/dist/utilities/anchor/anchor.d.ts +52 -0
  100. package/dist/utilities/anchor/anchor.js +136 -0
  101. package/dist/utilities/anchor/anchorMap.d.ts +21 -0
  102. package/dist/utilities/anchor/anchorMap.js +111 -0
  103. package/dist/utilities/utilities3D.d.ts +70 -26
  104. package/dist/utilities/utilities3D.js +265 -187
  105. package/dist/utilities/utilitiesColor.d.ts +18 -18
  106. package/dist/utilities/utilitiesColor.js +48 -48
  107. package/dist/utilities/utilitiesImage.d.ts +6 -6
  108. package/dist/utilities/utilitiesImage.js +107 -107
  109. package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -5
  110. package/dist/utilities/utilitiesSymRootIdentifier.js +26 -20
  111. package/dist/view/BaseView.d.ts +78 -70
  112. package/dist/view/BaseView.js +297 -291
  113. package/dist/view/BaseViewConfiguration.d.ts +32 -32
  114. package/dist/view/BaseViewConfiguration.js +8 -8
  115. package/dist/view/RenderEnv.d.ts +43 -38
  116. package/dist/view/RenderEnv.js +7 -7
  117. package/dist/view/SingleProductDefaultCameraView.d.ts +33 -33
  118. package/dist/view/SingleProductDefaultCameraView.js +141 -141
  119. package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +46 -46
  120. package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
  121. package/dist/view/SingleProductView.d.ts +49 -42
  122. package/dist/view/SingleProductView.js +206 -205
  123. package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
  124. package/dist/view/SingleProductViewConfiguration.js +19 -19
  125. package/package.json +5 -5
@@ -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 = {};
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 = {};
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,47 +1,47 @@
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
- }
41
- prepareForExit(_node) {
42
- return __awaiter(this, void 0, void 0, function* () { });
43
- }
44
- prepareForMaterialChange(_node, _isNewProduct) {
45
- return __awaiter(this, void 0, void 0, function* () { });
46
- }
47
- }
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
+ }
41
+ prepareForExit(_node) {
42
+ return __awaiter(this, void 0, void 0, function* () { });
43
+ }
44
+ prepareForMaterialChange(_node, _isNewProduct) {
45
+ return __awaiter(this, void 0, void 0, function* () { });
46
+ }
47
+ }
@@ -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