@kokoa/clotho-editor 0.1.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.
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/dist/chunk-UE32Q6U5.js +943 -0
- package/dist/chunk-UE32Q6U5.js.map +1 -0
- package/dist/clotho-editor.css +1921 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +425 -0
- package/dist/index.js.map +1 -0
- package/dist/main-SWHHYTLM.js +16214 -0
- package/dist/main-SWHHYTLM.js.map +1 -0
- package/docs/PORTING.md +136 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shinkeonkim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @kokoa/clotho-editor
|
|
2
|
+
|
|
3
|
+
[clotho](../clotho) 애니메이션 문서를 위한 비주얼 에디터.
|
|
4
|
+
|
|
5
|
+
## 상태
|
|
6
|
+
|
|
7
|
+
두 블로그 저장소 안에 있던 Studio(약 8,900 LOC)를 clotho
|
|
8
|
+
기반 독립 패키지로 옮겼다. typecheck 0 errors, 빌드·테스트 통과.
|
|
9
|
+
|
|
10
|
+
이식에서 가장 의미 있는 변화는 **미리보기가 clotho를 쓴다**는 점이다. Studio는 자체
|
|
11
|
+
캔버스 렌더를 갖고 있어 에디터에서 맞게 보이는 것이 사이트에서 다르게 보일 수 있었다.
|
|
12
|
+
이제 `buildScene` + `patchScene`을 지나므로 에디터와 배포본이 갈라질 수 없다.
|
|
13
|
+
|
|
14
|
+
자세한 내용과 남은 정리 항목은 [`docs/PORTING.md`](./docs/PORTING.md).
|
|
15
|
+
|
|
16
|
+
## 사용
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @kokoa/clotho @kokoa/clotho-editor react react-dom
|
|
20
|
+
# yarn add / pnpm add / bun add 도 같은 패키지 목록을 사용한다.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Studio, configureApi, configureHost } from "@kokoa/clotho-editor";
|
|
25
|
+
import "@kokoa/clotho-editor/styles.css";
|
|
26
|
+
|
|
27
|
+
// 문서가 어디 저장되는지는 호스트가 정한다. 기본값은 원래 Studio가 쓰던 경로다.
|
|
28
|
+
configureApi({ baseUrl: "/api/admin/animations" });
|
|
29
|
+
configureHost({ placeholderImageUrl: "/uploads/placeholder.png" });
|
|
30
|
+
|
|
31
|
+
<Studio initial={doc} onSave={handleSave} />;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`Studio`는 저장 방식을 호스트가 소유하는 삽입형 컴포넌트다. 기존 API 경로를 그대로 쓰는
|
|
35
|
+
완성형 화면이 필요하면 `<StudioMount initialId="document-id" />`를 사용한다. 일반적인
|
|
36
|
+
Vite/Next.js/React SPA에 둘 다 삽입할 수 있고, 브라우저 전용 코드는 mount 이후에
|
|
37
|
+
초기화된다.
|
|
38
|
+
|
|
39
|
+
## 개발
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bun install
|
|
43
|
+
bun run typecheck
|
|
44
|
+
bun test
|
|
45
|
+
bun run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
개발 시에는 devDependency가 이웃 `../clotho`를 가리킨다. 배포물에는 이 경로가 포함되지
|
|
49
|
+
않고 `^0.1.0` peer 계약만 노출된다. 배포 순서와 검증은
|
|
50
|
+
[`../clotho/docs/RELEASING.md`](../clotho/docs/RELEASING.md)를 따른다.
|
|
51
|
+
|
|
52
|
+
## 라이선스
|
|
53
|
+
|
|
54
|
+
MIT
|