@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 CHANGED
@@ -14,11 +14,11 @@ S14P21M104 가상 피팅(WebAR) 프로젝트를 위한 공식 프론트엔드 Re
14
14
 
15
15
  ## 🛠 설치 방법 (Installation)
16
16
 
17
- 이 패키지는 사내 또는 외부 NPM에 직접 배포되기 전 로컬 저장소를 통한 심볼릭 링크(Symbolic Link) 방식으로 연결하거나 파일 디렉토리를 참조하여 사용할 수 있습니다.
17
+ 이 패키지는 배포 전 로컬 검증 tarball로 패키징한 소비 애플리케이션에 설치해서 확인하는 방식을 권장합니다.
18
18
 
19
- ### 로컬 프로젝트에서 참조하여 설치할 경우:
19
+ ### 배포된 패키지 설치
20
20
 
21
- 여러분의 Next.js 프로젝트 최상위 폴더(`frontend`)에서 아래 명령어를 실행하세요.
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: any[], targetBones: Record<string, THREE.Bone>) => void;
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
@@ -1,5 +1,6 @@
1
1
  export * from "./store/useEverStore";
2
2
  export * from "./components/EverProvider";
3
+ export * from "./components/ever-context";
3
4
  export * from "./components/EverCanvas";
4
5
  export * from "./components/CameraView";
5
6
  export * from "./components/AvatarModel";
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), gg = () => {
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
- }, _g = ({ children: e }) => {
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.isBone && (e[t.name] = 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.isSkinnedMesh) {
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 };