@ssafy-mhk/e-ver 1.0.2 → 1.0.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.
- package/README.md +17 -3
- package/dist/api/EverClient.test.d.ts +1 -0
- package/dist/components/EverProvider.d.ts +0 -8
- package/dist/components/ever-context.d.ts +9 -0
- package/dist/hooks/useBodyMeasurer.test.d.ts +1 -0
- package/dist/hooks/useEverGeneration.test.d.ts +1 -0
- package/dist/hooks/usePoseMapper.d.ts +7 -1
- package/dist/hooks/usePoseTracker.test.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +9 -5
- package/dist/index.umd.js +3 -3
- package/dist/store/useEverStore.d.ts +10 -3
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ S14P21M104 가상 피팅(WebAR) 프로젝트를 위한 공식 프론트엔드 Re
|
|
|
14
14
|
|
|
15
15
|
## 🛠 설치 방법 (Installation)
|
|
16
16
|
|
|
17
|
-
이 패키지는
|
|
17
|
+
이 패키지는 배포 전 로컬 검증 시 tarball로 패키징한 뒤 소비 애플리케이션에 설치해서 확인하는 방식을 권장합니다.
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### 배포된 패키지 설치
|
|
20
20
|
|
|
21
|
-
여러분의 Next.js 프로젝트 최상위
|
|
21
|
+
여러분의 Next.js 프로젝트 최상위 폴더에서 아래 명령어를 실행하세요.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
# pnpm 사용 시
|
|
@@ -31,6 +31,20 @@ yarn add @ssafy-mhk/e-ver
|
|
|
31
31
|
|
|
32
32
|
_(의존성 설치가 잘 되었는지 꼭 `package.json` 코드를 확인하세요.)_
|
|
33
33
|
|
|
34
|
+
### 이 레포에서 `frontend`로 로컬 검증할 경우
|
|
35
|
+
|
|
36
|
+
`/ever/frontend`에서 아래 명령어를 실행하면 `/ever/sdk`를 빌드하고 tarball로 패키징한 뒤 현재 프론트엔드에 설치합니다.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm run sdk:use-tarball
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
검증 후 퍼블리시된 버전으로 되돌릴 때는 아래 명령어를 사용합니다.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm run sdk:use-version -- 1.0.3
|
|
46
|
+
```
|
|
47
|
+
|
|
34
48
|
---
|
|
35
49
|
|
|
36
50
|
## 🚀 코어로직 한눈에 보기 (SDK 핵심 요소)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
export interface EverContextType {
|
|
4
|
-
videoRef: React.RefObject<HTMLVideoElement | null>;
|
|
5
|
-
avatarBones: Record<string, THREE.Bone> | null;
|
|
6
|
-
setAvatarBones: (bones: Record<string, THREE.Bone> | null) => void;
|
|
7
|
-
isProviderReady: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const useEver: () => EverContextType;
|
|
10
2
|
export interface EverProviderProps {
|
|
11
3
|
children: React.ReactNode;
|
|
12
4
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export interface EverContextType {
|
|
3
|
+
videoRef: React.RefObject<HTMLVideoElement | null>;
|
|
4
|
+
avatarBones: Record<string, THREE.Bone> | null;
|
|
5
|
+
setAvatarBones: (bones: Record<string, THREE.Bone> | null) => void;
|
|
6
|
+
isProviderReady: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const EverContext: import("react").Context<EverContextType | undefined>;
|
|
9
|
+
export declare function useEver(): EverContextType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
+
interface PoseLandmark {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Custom hook to map MediaPipe 2D/3D landmarks to 3D bones (Quaternions).
|
|
4
9
|
*/
|
|
5
10
|
export declare const usePoseMapper: () => {
|
|
6
|
-
mapPoseToBones: (landmarks:
|
|
11
|
+
mapPoseToBones: (landmarks: PoseLandmark[], targetBones: Record<string, THREE.Bone>) => void;
|
|
7
12
|
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -17837,11 +17837,15 @@ var mg = class {
|
|
|
17837
17837
|
let t = this.getContext();
|
|
17838
17838
|
t.drawingBufferColorSpace = $n._getDrawingBufferColorSpace(e), t.unpackColorSpace = $n._getUnpackColorSpace();
|
|
17839
17839
|
}
|
|
17840
|
-
}, hg = i(void 0)
|
|
17840
|
+
}, hg = i(void 0);
|
|
17841
|
+
function gg() {
|
|
17841
17842
|
let e = o(hg);
|
|
17842
17843
|
if (!e) throw Error("useEver must be used within an EverProvider");
|
|
17843
17844
|
return e;
|
|
17844
|
-
}
|
|
17845
|
+
}
|
|
17846
|
+
//#endregion
|
|
17847
|
+
//#region src/components/EverProvider.tsx
|
|
17848
|
+
var _g = ({ children: e }) => {
|
|
17845
17849
|
let t = u(null), [n, r] = d(null), i = {
|
|
17846
17850
|
videoRef: t,
|
|
17847
17851
|
avatarBones: n,
|
|
@@ -35941,7 +35945,7 @@ var Ux = ({ children: e, showEnvironment: t = !0 }) => /* @__PURE__ */ p(_g, { c
|
|
|
35941
35945
|
if (!n) return;
|
|
35942
35946
|
let e = {};
|
|
35943
35947
|
return n.traverse((t) => {
|
|
35944
|
-
t
|
|
35948
|
+
t instanceof oo && (e[t.name] = t);
|
|
35945
35949
|
}), i(e), t && t(e), () => i(null);
|
|
35946
35950
|
}, [
|
|
35947
35951
|
n,
|
|
@@ -35959,7 +35963,7 @@ var Ux = ({ children: e, showEnvironment: t = !0 }) => /* @__PURE__ */ p(_g, { c
|
|
|
35959
35963
|
let { scene: n } = ax(e), r = u(null), { avatarBones: i } = gg(), a = t || i;
|
|
35960
35964
|
return s(() => {
|
|
35961
35965
|
!n || !a || n.traverse((e) => {
|
|
35962
|
-
if (e
|
|
35966
|
+
if (e instanceof ao) {
|
|
35963
35967
|
let t = e, n = [];
|
|
35964
35968
|
t.skeleton.bones.forEach((e) => {
|
|
35965
35969
|
a[e.name] ? n.push(a[e.name]) : n.push(e);
|
|
@@ -40789,4 +40793,4 @@ function iM(e) {
|
|
|
40789
40793
|
};
|
|
40790
40794
|
}
|
|
40791
40795
|
//#endregion
|
|
40792
|
-
export { Gx as AvatarModel, Wx as CameraView, Ux as EverCanvas, tM as EverClient, _g as EverProvider, qx as GarmentModel, Qj as useBodyMeasurer, gg as useEver, iM as useEverGeneration, E as useEverStore, Zj as usePoseMapper, Xj as usePoseTracker };
|
|
40796
|
+
export { Gx as AvatarModel, Wx as CameraView, Ux as EverCanvas, tM as EverClient, hg as EverContext, _g as EverProvider, qx as GarmentModel, Qj as useBodyMeasurer, gg as useEver, iM as useEverGeneration, E as useEverStore, Zj as usePoseMapper, Xj as usePoseTracker };
|