@memori.ai/memori-react 7.7.1 → 7.8.0-rc.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 (172) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/Avatar/Avatar.js +2 -2
  3. package/dist/components/Avatar/Avatar.js.map +1 -1
  4. package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.d.ts +6 -3
  5. package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +10 -6
  6. package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
  7. package/dist/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.d.ts +13 -17
  8. package/dist/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.js +110 -111
  9. package/dist/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.js.map +1 -1
  10. package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +3 -4
  11. package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js +77 -52
  12. package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js.map +1 -1
  13. package/dist/components/Avatar/AvatarView/index.d.ts +7 -3
  14. package/dist/components/Avatar/AvatarView/index.js +2 -2
  15. package/dist/components/Avatar/AvatarView/index.js.map +1 -1
  16. package/dist/components/MemoriWidget/MemoriWidget.js +34 -22
  17. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  18. package/dist/components/layouts/ZoomedFullBody.js +1 -8
  19. package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
  20. package/dist/components/layouts/zoomed-full-body.css +5 -1
  21. package/dist/context/visemeContext.d.ts +9 -15
  22. package/dist/context/visemeContext.js +73 -190
  23. package/dist/context/visemeContext.js.map +1 -1
  24. package/esm/components/Avatar/Avatar.js +2 -2
  25. package/esm/components/Avatar/Avatar.js.map +1 -1
  26. package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.d.ts +6 -3
  27. package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +10 -6
  28. package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
  29. package/esm/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.d.ts +13 -17
  30. package/esm/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.js +112 -113
  31. package/esm/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.js.map +1 -1
  32. package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +3 -4
  33. package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js +81 -55
  34. package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js.map +1 -1
  35. package/esm/components/Avatar/AvatarView/index.d.ts +7 -3
  36. package/esm/components/Avatar/AvatarView/index.js +2 -2
  37. package/esm/components/Avatar/AvatarView/index.js.map +1 -1
  38. package/esm/components/MemoriWidget/MemoriWidget.js +34 -22
  39. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  40. package/esm/components/layouts/ZoomedFullBody.js +1 -8
  41. package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
  42. package/esm/components/layouts/zoomed-full-body.css +5 -1
  43. package/esm/context/visemeContext.d.ts +9 -15
  44. package/esm/context/visemeContext.js +74 -191
  45. package/esm/context/visemeContext.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/components/Avatar/Avatar.tsx +5 -5
  48. package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +33 -19
  49. package/src/components/Avatar/AvatarView/AvatarComponent/components/fullbodyAvatar.tsx +181 -158
  50. package/src/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.tsx +116 -71
  51. package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +12 -24
  52. package/src/components/Avatar/AvatarView/index.tsx +9 -8
  53. package/src/components/MemoriWidget/MemoriWidget.tsx +45 -38
  54. package/src/components/layouts/ZoomedFullBody.tsx +6 -11
  55. package/src/components/layouts/zoomed-full-body.css +5 -1
  56. package/src/context/visemeContext.tsx +130 -283
  57. package/dist/components/AttachmentMediaModal/AttachmentMediaModal.d.ts +0 -14
  58. package/dist/components/AttachmentMediaModal/AttachmentMediaModal.js +0 -66
  59. package/dist/components/AttachmentMediaModal/AttachmentMediaModal.js.map +0 -1
  60. package/dist/components/Avatar/AvatarView/components/controls.d.ts +0 -23
  61. package/dist/components/Avatar/AvatarView/components/controls.js +0 -55
  62. package/dist/components/Avatar/AvatarView/components/controls.js.map +0 -1
  63. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.d.ts +0 -19
  64. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.js +0 -61
  65. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.js.map +0 -1
  66. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.d.ts +0 -9
  67. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.js +0 -39
  68. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.js.map +0 -1
  69. package/dist/components/Avatar/AvatarView/components/loader.d.ts +0 -5
  70. package/dist/components/Avatar/AvatarView/components/loader.js +0 -12
  71. package/dist/components/Avatar/AvatarView/components/loader.js.map +0 -1
  72. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.d.ts +0 -2
  73. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.js +0 -68
  74. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.js.map +0 -1
  75. package/dist/components/AvatarView/components/avatar.d.ts +0 -9
  76. package/dist/components/AvatarView/components/avatar.js +0 -35
  77. package/dist/components/AvatarView/components/avatar.js.map +0 -1
  78. package/dist/components/AvatarView/components/fullbodyAvatar.d.ts +0 -10
  79. package/dist/components/AvatarView/components/fullbodyAvatar.js +0 -62
  80. package/dist/components/AvatarView/components/fullbodyAvatar.js.map +0 -1
  81. package/dist/components/AvatarView/components/loader.d.ts +0 -5
  82. package/dist/components/AvatarView/components/loader.js +0 -12
  83. package/dist/components/AvatarView/components/loader.js.map +0 -1
  84. package/dist/components/AvatarView/index.d.ts +0 -17
  85. package/dist/components/AvatarView/index.js +0 -35
  86. package/dist/components/AvatarView/index.js.map +0 -1
  87. package/dist/components/AvatarView/utils/useEyeBlink.d.ts +0 -2
  88. package/dist/components/AvatarView/utils/useEyeBlink.js +0 -40
  89. package/dist/components/AvatarView/utils/useEyeBlink.js.map +0 -1
  90. package/dist/components/AvatarView/utils/useHeadMovement.d.ts +0 -2
  91. package/dist/components/AvatarView/utils/useHeadMovement.js +0 -53
  92. package/dist/components/AvatarView/utils/useHeadMovement.js.map +0 -1
  93. package/dist/components/AvatarView/utils/useLoadingMorphAnim.d.ts +0 -2
  94. package/dist/components/AvatarView/utils/useLoadingMorphAnim.js +0 -34
  95. package/dist/components/AvatarView/utils/useLoadingMorphAnim.js.map +0 -1
  96. package/dist/components/AvatarView/utils/useMouthSpeaking.d.ts +0 -2
  97. package/dist/components/AvatarView/utils/useMouthSpeaking.js +0 -60
  98. package/dist/components/AvatarView/utils/useMouthSpeaking.js.map +0 -1
  99. package/dist/components/AvatarView/utils/useSmile.d.ts +0 -2
  100. package/dist/components/AvatarView/utils/useSmile.js +0 -30
  101. package/dist/components/AvatarView/utils/useSmile.js.map +0 -1
  102. package/dist/components/AvatarView/utils/utils.d.ts +0 -13
  103. package/dist/components/AvatarView/utils/utils.js +0 -42
  104. package/dist/components/AvatarView/utils/utils.js.map +0 -1
  105. package/dist/components/ImageUpload/ImageUpload.css +0 -168
  106. package/dist/components/ImageUpload/ImageUpload.d.ts +0 -28
  107. package/dist/components/ImageUpload/ImageUpload.js +0 -163
  108. package/dist/components/ImageUpload/ImageUpload.js.map +0 -1
  109. package/dist/components/layouts/Default.d.ts +0 -17
  110. package/dist/components/layouts/Default.js +0 -8
  111. package/dist/components/layouts/Default.js.map +0 -1
  112. package/dist/components/ui/Message.d.ts +0 -17
  113. package/dist/components/ui/Message.js +0 -13
  114. package/dist/components/ui/Message.js.map +0 -1
  115. package/esm/components/AttachmentMediaModal/AttachmentMediaModal.d.ts +0 -14
  116. package/esm/components/AttachmentMediaModal/AttachmentMediaModal.js +0 -63
  117. package/esm/components/AttachmentMediaModal/AttachmentMediaModal.js.map +0 -1
  118. package/esm/components/Avatar/AvatarView/components/controls.d.ts +0 -23
  119. package/esm/components/Avatar/AvatarView/components/controls.js +0 -52
  120. package/esm/components/Avatar/AvatarView/components/controls.js.map +0 -1
  121. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.d.ts +0 -19
  122. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.js +0 -57
  123. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.js.map +0 -1
  124. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.d.ts +0 -9
  125. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.js +0 -35
  126. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.js.map +0 -1
  127. package/esm/components/Avatar/AvatarView/components/loader.d.ts +0 -5
  128. package/esm/components/Avatar/AvatarView/components/loader.js +0 -9
  129. package/esm/components/Avatar/AvatarView/components/loader.js.map +0 -1
  130. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.d.ts +0 -2
  131. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.js +0 -65
  132. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.js.map +0 -1
  133. package/esm/components/AvatarView/components/avatar.d.ts +0 -9
  134. package/esm/components/AvatarView/components/avatar.js +0 -31
  135. package/esm/components/AvatarView/components/avatar.js.map +0 -1
  136. package/esm/components/AvatarView/components/fullbodyAvatar.d.ts +0 -10
  137. package/esm/components/AvatarView/components/fullbodyAvatar.js +0 -58
  138. package/esm/components/AvatarView/components/fullbodyAvatar.js.map +0 -1
  139. package/esm/components/AvatarView/components/loader.d.ts +0 -5
  140. package/esm/components/AvatarView/components/loader.js +0 -9
  141. package/esm/components/AvatarView/components/loader.js.map +0 -1
  142. package/esm/components/AvatarView/index.d.ts +0 -17
  143. package/esm/components/AvatarView/index.js +0 -31
  144. package/esm/components/AvatarView/index.js.map +0 -1
  145. package/esm/components/AvatarView/utils/useEyeBlink.d.ts +0 -2
  146. package/esm/components/AvatarView/utils/useEyeBlink.js +0 -37
  147. package/esm/components/AvatarView/utils/useEyeBlink.js.map +0 -1
  148. package/esm/components/AvatarView/utils/useHeadMovement.d.ts +0 -2
  149. package/esm/components/AvatarView/utils/useHeadMovement.js +0 -50
  150. package/esm/components/AvatarView/utils/useHeadMovement.js.map +0 -1
  151. package/esm/components/AvatarView/utils/useLoadingMorphAnim.d.ts +0 -2
  152. package/esm/components/AvatarView/utils/useLoadingMorphAnim.js +0 -31
  153. package/esm/components/AvatarView/utils/useLoadingMorphAnim.js.map +0 -1
  154. package/esm/components/AvatarView/utils/useMouthSpeaking.d.ts +0 -2
  155. package/esm/components/AvatarView/utils/useMouthSpeaking.js +0 -57
  156. package/esm/components/AvatarView/utils/useMouthSpeaking.js.map +0 -1
  157. package/esm/components/AvatarView/utils/useSmile.d.ts +0 -2
  158. package/esm/components/AvatarView/utils/useSmile.js +0 -27
  159. package/esm/components/AvatarView/utils/useSmile.js.map +0 -1
  160. package/esm/components/AvatarView/utils/utils.d.ts +0 -13
  161. package/esm/components/AvatarView/utils/utils.js +0 -33
  162. package/esm/components/AvatarView/utils/utils.js.map +0 -1
  163. package/esm/components/ImageUpload/ImageUpload.css +0 -168
  164. package/esm/components/ImageUpload/ImageUpload.d.ts +0 -28
  165. package/esm/components/ImageUpload/ImageUpload.js +0 -160
  166. package/esm/components/ImageUpload/ImageUpload.js.map +0 -1
  167. package/esm/components/layouts/Default.d.ts +0 -17
  168. package/esm/components/layouts/Default.js +0 -5
  169. package/esm/components/layouts/Default.js.map +0 -1
  170. package/esm/components/ui/Message.d.ts +0 -17
  171. package/esm/components/ui/Message.js +0 -10
  172. package/esm/components/ui/Message.js.map +0 -1
@@ -1,37 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useFrame } from '@react-three/fiber';
3
- let blinkTime = 999;
4
- let timeout;
5
- let headMesh;
6
- let morphIndex = 0;
7
- const setNextBlink = () => {
8
- blinkTime = 0;
9
- timeout = setTimeout(setNextBlink, Math.random() * 5000 + 2000);
10
- };
11
- export default function useEyeBlink(enabled, nodes) {
12
- useEffect(() => {
13
- if (!enabled)
14
- return;
15
- headMesh = (nodes.Wolf3D_Head || nodes.Wolf3D_Avatar);
16
- if ((headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetDictionary) && (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences)) {
17
- morphIndex = headMesh.morphTargetDictionary.eyesClosed;
18
- }
19
- timeout = setTimeout(setNextBlink, 3000);
20
- return () => {
21
- clearTimeout(timeout);
22
- };
23
- }, [nodes, enabled]);
24
- useFrame((_, delta) => {
25
- if (!enabled)
26
- return;
27
- if (blinkTime < 2 && (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences)) {
28
- let value = Math.abs(Math.sin((blinkTime * Math.PI) / 2));
29
- blinkTime += delta * 10;
30
- headMesh.morphTargetInfluences[morphIndex] = value;
31
- }
32
- else if (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences) {
33
- headMesh.morphTargetInfluences[morphIndex] = 0;
34
- }
35
- });
36
- }
37
- //# sourceMappingURL=useEyeBlink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEyeBlink.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/useEyeBlink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,IAAI,SAAS,GAAW,GAAG,CAAC;AAC5B,IAAI,OAAuB,CAAC;AAE5B,IAAI,QAAqB,CAAC;AAC1B,IAAI,UAAU,GAAW,CAAC,CAAC;AAE3B,MAAM,Y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AI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,EAAE;YAC1C,QAAQ,CAAC,qBAAqB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;SAChD;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Nodes } from './utils';
2
- export default function useHeadMovement(enabled: boolean | undefined, nodes: Nodes): void;
@@ -1,50 +0,0 @@
1
- import { Vector2 } from 'three';
2
- import { useEffect } from 'react';
3
- import { lerp, mapRange } from './utils';
4
- import { useFrame, useThree } from '@react-three/fiber';
5
- const rad = Math.PI / 180;
6
- let reset = false;
7
- let timeout;
8
- const targetPos = new Vector2(0, 0);
9
- const currentPos = new Vector2(0, 0);
10
- const setResetTrue = () => {
11
- timeout = setTimeout(() => {
12
- reset = true;
13
- }, 1000);
14
- };
15
- const setResetFalse = () => {
16
- clearTimeout(timeout);
17
- reset = false;
18
- };
19
- export default function useHeadMovement(enabled, nodes) {
20
- const { gl } = useThree();
21
- useEffect(() => {
22
- if (!enabled)
23
- return;
24
- gl.domElement.addEventListener('mouseleave', setResetTrue);
25
- gl.domElement.addEventListener('mouseenter', setResetFalse);
26
- return () => {
27
- gl.domElement.removeEventListener('mouseleave', setResetTrue);
28
- gl.domElement.removeEventListener('mouseenter', setResetFalse);
29
- };
30
- }, [gl.domElement, enabled]);
31
- useFrame(state => {
32
- if (!enabled || !(nodes === null || nodes === void 0 ? void 0 : nodes.Neck) || !(nodes === null || nodes === void 0 ? void 0 : nodes.Head))
33
- return;
34
- const cameraRotation = Math.abs(state.camera.rotation.z);
35
- if (!reset && cameraRotation < 0.2) {
36
- targetPos.x = mapRange(state.mouse.y, -1, 1, 5 * rad, -5 * rad);
37
- targetPos.y = mapRange(state.mouse.x, -1, 1, -10 * rad, 10 * rad);
38
- }
39
- else {
40
- targetPos.set(0, 0);
41
- }
42
- currentPos.x = lerp(currentPos.x, targetPos.x);
43
- currentPos.y = lerp(currentPos.y, targetPos.y);
44
- nodes.Neck.rotation.x = currentPos.x + 0.1;
45
- nodes.Neck.rotation.y = currentPos.y;
46
- nodes.Head.rotation.x = currentPos.x * 2;
47
- nodes.Head.rotation.y = currentPos.y * 2;
48
- });
49
- }
50
- //# sourceMappingURL=useHeadMovement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHeadMovement.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/useHeadMovement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAG1B,IAAI,KAAK,GAAY,KAAK,CAAC;AAC3B,IAAI,OAAuB,CAAC;AAE5B,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErC,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;QACxB,KAAK,GAAG,IAAI,CAAC;IACf,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,KAAK,GAAG,KAAK,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,OAA4B,EAC5B,KAAY;IAEZ,MAAM,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE1B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,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,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QAC/C,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QAE/C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QAErC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC;IAO3C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Nodes } from './utils';
2
- export default function useLoadingMorphAnim(loading: boolean | undefined, nodes: Nodes): void;
@@ -1,31 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useFrame } from '@react-three/fiber';
3
- let headMesh;
4
- let eyesClosedMorphIndex = 0;
5
- let viseme_UMorphIndex = 0;
6
- export default function useLoadingMorphAnim(loading, nodes) {
7
- useEffect(() => {
8
- if (!loading)
9
- return;
10
- headMesh = (nodes.Wolf3D_Head ||
11
- nodes.Wolf3D_Avatar ||
12
- nodes.Wolf3D_Avatar001);
13
- if ((headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetDictionary) && (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences)) {
14
- eyesClosedMorphIndex = headMesh.morphTargetDictionary.mouthOpen;
15
- viseme_UMorphIndex = headMesh.morphTargetDictionary.viseme_U;
16
- }
17
- }, [nodes, loading]);
18
- useFrame(() => {
19
- if (!loading) {
20
- if (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences) {
21
- headMesh.morphTargetInfluences[eyesClosedMorphIndex] = 0;
22
- headMesh.morphTargetInfluences[viseme_UMorphIndex] = 0;
23
- }
24
- }
25
- else if (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences) {
26
- headMesh.morphTargetInfluences[eyesClosedMorphIndex] = 0.56;
27
- headMesh.morphTargetInfluences[viseme_UMorphIndex] = 0.67;
28
- }
29
- });
30
- }
31
- //# sourceMappingURL=useLoadingMorphAnim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLoadingMorphAnim.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/useLoadingMorphAnim.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,IAAI,QAAqB,CAAC;AAC1B,IAAI,oBAAoB,GAAW,CAAC,CAAC;AACrC,IAAI,kBAAkB,GAAW,CAAC,CAAC;AAEnC,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,OAA4B,EAC5B,KAAY;IAEZ,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,QAAQ,GAAG,CAAC,KAAK,CAAC,WAAW;YAC3B,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,gBAAgB,CAAgB,CAAC;QAEzC,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,MAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,CAAA,EAAE;YACtE,oBAAoB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC;YAChE,kBAAkB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC;SAC9D;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,QAAQ,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,EAAE;gBACnC,QAAQ,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;gBACzD,QAAQ,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;aACxD;SACF;aAAM,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,EAAE;YAC1C,QAAQ,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;YAC5D,QAAQ,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Nodes } from './utils';
2
- export default function useMouthSpeaking(speaking: boolean | undefined, nodes: Nodes): void;
@@ -1,57 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useFrame } from '@react-three/fiber';
3
- let mouthMoveTime = 999;
4
- let timeout;
5
- let mouthMesh;
6
- let mouthOpenMorphIndex = 0;
7
- let mouthSmileMorphIndex = 0;
8
- let mouthFunnerMorphIndex = 0;
9
- let mouthPuckerMorphIndex = 0;
10
- const setNextMouthOpen = () => {
11
- mouthMoveTime = 0;
12
- timeout = setTimeout(setNextMouthOpen, Math.random() * 500);
13
- };
14
- export default function useMouthSpeaking(speaking, nodes) {
15
- useEffect(() => {
16
- if (!speaking)
17
- return;
18
- mouthMesh = (nodes.Wolf3D_Head ||
19
- nodes.Wolf3D_Avatar ||
20
- nodes.Wolf3D_Avatar001);
21
- if ((mouthMesh === null || mouthMesh === void 0 ? void 0 : mouthMesh.morphTargetDictionary) && (mouthMesh === null || mouthMesh === void 0 ? void 0 : mouthMesh.morphTargetInfluences)) {
22
- mouthOpenMorphIndex = mouthMesh.morphTargetDictionary.mouthOpen;
23
- mouthSmileMorphIndex = mouthMesh.morphTargetDictionary.mouthSmile;
24
- mouthFunnerMorphIndex = mouthMesh.morphTargetDictionary.mouthFunner;
25
- mouthPuckerMorphIndex = mouthMesh.morphTargetDictionary.mouthPucker;
26
- }
27
- timeout = setTimeout(setNextMouthOpen, 200);
28
- return () => {
29
- clearTimeout(timeout);
30
- };
31
- }, [nodes, speaking]);
32
- useFrame((_, delta) => {
33
- if (!speaking) {
34
- if (mouthMesh === null || mouthMesh === void 0 ? void 0 : mouthMesh.morphTargetInfluences) {
35
- mouthMesh.morphTargetInfluences[mouthOpenMorphIndex] = 0;
36
- mouthMesh.morphTargetInfluences[mouthSmileMorphIndex] = 0;
37
- mouthMesh.morphTargetInfluences[mouthFunnerMorphIndex] = 0;
38
- mouthMesh.morphTargetInfluences[mouthPuckerMorphIndex] = 0;
39
- }
40
- }
41
- else if (mouthMoveTime < 2 && (mouthMesh === null || mouthMesh === void 0 ? void 0 : mouthMesh.morphTargetInfluences)) {
42
- let value = Math.abs(Math.sin((mouthMoveTime * Math.PI) / 2));
43
- mouthMoveTime += delta * 10;
44
- mouthMesh.morphTargetInfluences[mouthOpenMorphIndex] = value / 3;
45
- mouthMesh.morphTargetInfluences[mouthSmileMorphIndex] = value / 10;
46
- mouthMesh.morphTargetInfluences[mouthFunnerMorphIndex] = value / 7;
47
- mouthMesh.morphTargetInfluences[mouthPuckerMorphIndex] = value / 5;
48
- }
49
- else if (mouthMesh === null || mouthMesh === void 0 ? void 0 : mouthMesh.morphTargetInfluences) {
50
- mouthMesh.morphTargetInfluences[mouthOpenMorphIndex] = 0;
51
- mouthMesh.morphTargetInfluences[mouthSmileMorphIndex] = 0;
52
- mouthMesh.morphTargetInfluences[mouthFunnerMorphIndex] = 0;
53
- mouthMesh.morphTargetInfluences[mouthPuckerMorphIndex] = 0;
54
- }
55
- });
56
- }
57
- //# sourceMappingURL=useMouthSpeaking.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMouthSpeaking.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/useMouthSpeaking.ts"],"names":[],"mappings":"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BAAmB,CAAC,GAAG,CAAC,CAAC;YACzD,SAAS,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;YAC1D,SAAS,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC;YAC3D,SAAS,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Nodes } from './utils';
2
- export default function useSmile(smiling: boolean | undefined, nodes: Nodes): void;
@@ -1,27 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useFrame } from '@react-three/fiber';
3
- let headMesh;
4
- let mouthSmileMorphIndex = 0;
5
- export default function useSmile(smiling, nodes) {
6
- useEffect(() => {
7
- if (!smiling)
8
- return;
9
- headMesh = (nodes.Wolf3D_Head ||
10
- nodes.Wolf3D_Avatar ||
11
- nodes.Wolf3D_Avatar001);
12
- if ((headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetDictionary) && (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences)) {
13
- mouthSmileMorphIndex = headMesh.morphTargetDictionary.mouthSmile;
14
- }
15
- }, [nodes, smiling]);
16
- useFrame(() => {
17
- if (!smiling) {
18
- if (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences) {
19
- headMesh.morphTargetInfluences[mouthSmileMorphIndex] = 0;
20
- }
21
- }
22
- else if (headMesh === null || headMesh === void 0 ? void 0 : headMesh.morphTargetInfluences) {
23
- headMesh.morphTargetInfluences[mouthSmileMorphIndex] = 1 / 3;
24
- }
25
- });
26
- }
27
- //# sourceMappingURL=useSmile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSmile.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/useSmile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,IAAI,QAAqB,CAAC;AAC1B,IAAI,oBAAoB,GAAW,CAAC,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAA4B,EAAE,KAAY;IACzE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,QAAQ,GAAG,CAAC,KAAK,CAAC,WAAW;YAC3B,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,gBAAgB,CAAgB,CAAC;QAEzC,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,MAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,CAAA,EAAE;YACtE,oBAAoB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,UAAU,CAAC;SAClE;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,QAAQ,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,EAAE;gBACnC,QAAQ,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;aAC1D;SACF;aAAM,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,EAAE;YAC1C,QAAQ,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SAC9D;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Material, Object3D } from 'three';
2
- export interface Nodes {
3
- [name: string]: Object3D;
4
- }
5
- export interface Materials {
6
- [name: string]: Material;
7
- }
8
- export declare const clamp: (value: number, min: number, max: number) => number;
9
- export declare const lerp: (start: number, end: number, time?: number) => number;
10
- export declare const mapRange: (value: number, inMin: number, inMax: number, outMin: number, outMax: number) => number;
11
- export declare const hideHands: (nodes: Nodes) => void;
12
- export declare const correctMaterials: (materials: Materials) => void;
13
- export declare const isSkinnedMesh: (node: Object3D) => boolean;
@@ -1,33 +0,0 @@
1
- import { LinearFilter } from 'three';
2
- export const clamp = (value, min, max) => {
3
- return Math.min(Math.max(value, min), max);
4
- };
5
- export const lerp = (start, end, time = 0.05) => {
6
- return start * (1 - time) + end * time;
7
- };
8
- export const mapRange = (value, inMin, inMax, outMin, outMax) => {
9
- value = clamp(value, inMin, inMax);
10
- return ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
11
- };
12
- export const hideHands = (nodes) => {
13
- if (nodes.Wolf3D_Hands) {
14
- nodes.Wolf3D_Hands.visible = false;
15
- }
16
- if (nodes.RightHand && nodes.LeftHand) {
17
- nodes.RightHand.position.set(0, -2, 0);
18
- nodes.LeftHand.position.set(0, -2, 0);
19
- }
20
- };
21
- export const correctMaterials = (materials) => {
22
- Object.values(materials).forEach((material) => {
23
- if (material.map)
24
- material.map.minFilter = LinearFilter;
25
- if (material)
26
- material.depthWrite = true;
27
- });
28
- };
29
- const SkinnedMeshType = 'SkinnedMesh';
30
- export const isSkinnedMesh = (node) => {
31
- return node.type === SkinnedMeshType;
32
- };
33
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/AvatarView/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAUrC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE;IAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,OAAe,IAAI,EAAE,EAAE;I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F,MAAM,eAAe,GAAG,aAAa,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAc,EAAE,EAAE;IAC9C,OAAO,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC;AACvC,CAAC,CAAC"}
@@ -1,168 +0,0 @@
1
- legend.helper {
2
- display: inline-block;
3
- width: auto;
4
- border: 0;
5
- margin: 0;
6
- margin-bottom: 1rem;
7
- font-size: 0.9em;
8
- }
9
-
10
- legend.helper p {
11
- margin-bottom: 0;
12
- }
13
-
14
- .memori--upload .ant-upload-list-picture-card-container,
15
- .memori--upload .ant-upload.ant-upload-select-picture-card {
16
- width: auto;
17
- min-width: 100px;
18
- max-width: 200px;
19
- height: auto;
20
- min-height: 100px;
21
- }
22
-
23
- .memori--upload .ant-upload.ant-upload-select-picture-card {
24
- flex-direction: column;
25
- align-items: center;
26
- justify-content: center;
27
- padding: 2rem 1.5rem;
28
- border: 2px var(--medium-gray) dashed;
29
- border-radius: 7px;
30
- background: none;
31
- opacity: 0.7;
32
- }
33
-
34
- .memori--upload .ant-upload.ant-upload-select-picture-card .ant-upload {
35
- transition: color 0.3s ease;
36
- }
37
-
38
- .memori--upload .ant-upload.ant-upload-select-picture-card:hover,
39
- .memori--upload .ant-upload.ant-upload-select-picture-card:focus {
40
- border-color: var(--memori-primary);
41
- opacity: 1;
42
- }
43
-
44
- .memori--upload .ant-upload.ant-upload-select-picture-card:hover .ant-upload,
45
- .memori--upload .ant-upload.ant-upload-select-picture-card:focus .ant-upload {
46
- color: var(--memori-primary);
47
- }
48
-
49
- .memori--upload .ant-upload-list {
50
- display: flex;
51
- flex-wrap: wrap;
52
- }
53
-
54
- .memori--upload .ant-upload-list-item {
55
- overflow: hidden;
56
- padding: 0;
57
- border: 0;
58
- border-radius: 5px;
59
- box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.1);
60
- }
61
-
62
- .memori--upload .ant-upload-list-picture-card-container {
63
- margin-bottom: 1rem;
64
- }
65
-
66
- .memori--list-item-wrapper {
67
- position: relative;
68
- }
69
-
70
- .memori--list-item-wrapper .ant-spin-nested-loading,
71
- .memori--list-item-wrapper .ant-spin-container {
72
- height: 100%;
73
- }
74
-
75
- .memori--list-item-wrapper figure {
76
- margin-bottom: 0;
77
- }
78
-
79
- .memori--list-item-wrapper figure img {
80
- max-height: 200px;
81
- border-radius: 5px;
82
- object-fit: contain;
83
- }
84
-
85
- .memori--list-item-wrapper figure figcaption {
86
- padding: 1rem;
87
- font-size: 0.8rem;
88
- text-align: center;
89
- }
90
-
91
- .memori--list-item-wrapper .ant-upload-list-item-error .ant-upload-list-item-name {
92
- position: static;
93
- margin: 0 0 1rem;
94
- }
95
-
96
- .memori--list-item-wrapper .list-item-actions {
97
- position: absolute;
98
- top: 50%;
99
- left: 50%;
100
- display: flex;
101
- overflow: hidden;
102
- width: 0;
103
- height: 0;
104
- align-items: center;
105
- justify-content: center;
106
- border-radius: 5px;
107
- background: rgba(0, 0, 0, 0.1);
108
- opacity: 0;
109
- transition: all 0.2s ease;
110
- }
111
-
112
- .attachment-media-modal .memori-modal--panel {
113
- min-width: 50%;
114
- }
115
-
116
- .ant-upload-list-item-container {
117
- width: 200px !important;
118
- height: auto !important;
119
- }
120
-
121
- .ant-upload.ant-upload-select {
122
- width: 200px !important;
123
- height: 200px !important;
124
- }
125
-
126
- .memori--list-item-wrapper .list-item-actions a.action-button,
127
- .memori--list-item-wrapper .list-item-actions button.action-button {
128
- color: #fff;
129
- }
130
-
131
- .memori--list-item-wrapper .list-item-actions a.action-button + .action-button,
132
- .memori--list-item-wrapper .list-item-actions button.action-button + .action-button {
133
- margin-left: 0.5rem;
134
- }
135
-
136
- .memori--list-item-wrapper .list-item-actions a.action-button:hover,
137
- .memori--list-item-wrapper .list-item-actions button.action-button:hover,
138
- .memori--list-item-wrapper .list-item-actions a.action-button:focus,
139
- .memori--list-item-wrapper .list-item-actions button.action-button:focus {
140
- color: #fff;
141
- }
142
-
143
- .memori--list-item-wrapper:hover .list-item-actions,
144
- .memori--list-item-wrapper:focus .list-item-actions {
145
- top: 0;
146
- left: 0;
147
- width: 100%;
148
- height: 100%;
149
- background: rgba(0, 0, 0, 0.4);
150
- opacity: 1;
151
- }
152
-
153
- .media-title-label {
154
- display: block;
155
- margin-bottom: 0.5rem;
156
- font-size: 0.9rem;
157
- font-weight: 600;
158
- }
159
-
160
- .media-title-input {
161
- width: 100%;
162
- padding: 0.5rem 0.75rem;
163
- border: 1px solid #d9d9d9;
164
- border-radius: 5px;
165
- background: #fff;
166
- font-size: 0.9rem;
167
- font-weight: 400;
168
- }
@@ -1,28 +0,0 @@
1
- import { UploadFile } from 'antd/lib/upload/interface';
2
- import { Asset } from '@memori.ai/memori-api-client/dist/types';
3
- import React from 'react';
4
- export interface Props {
5
- uploadMultipleImages: boolean;
6
- maxNumberOfVisualizedUploads?: number;
7
- fileList?: any[];
8
- uploadUrl: string;
9
- apiUrl?: string;
10
- tenantID: string;
11
- maxFileSizeInMB?: number;
12
- fileResolution?: number[];
13
- useImageCrop?: boolean;
14
- uploadMessage: string;
15
- imageProportions?: number;
16
- imageProportionsHelper?: string;
17
- allowedMimeTypes?: string[];
18
- onRemove?: (file: UploadFile<any>) => Promise<boolean>;
19
- onUploadFinished?: (file: UploadFile) => void;
20
- onFileChanged?: (assetID: string, asset: Partial<Asset>) => void;
21
- onFileNotValid?: () => void;
22
- disabled?: boolean;
23
- showHelper?: boolean;
24
- additionalHelper?: string;
25
- resourceType?: 'avatar' | 'cover' | undefined;
26
- }
27
- declare const ImageUpload: React.FC<Props>;
28
- export default ImageUpload;