@sigma-studio/viewer 0.188.0 → 0.188.2

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 (2) hide show
  1. package/README.md +30 -1
  2. package/package.json +9 -1
package/README.md CHANGED
@@ -35,6 +35,36 @@ export function MaterialPage({ document }: { document: SigmaDocument }) {
35
35
 
36
36
  ホストが新しい`document`オブジェクトを渡すと、ViewerはSigmaDocを再検証して表示を更新します。Viewer自身はfetch、polling、保存を行いません。
37
37
 
38
+ ## AIコーディングエージェントに導入させる
39
+
40
+ AIエージェントは次の順序で導入してください。
41
+
42
+ 1. ホストがReact `>=18.2.0 <20`を使用していることを確認する
43
+ 2. `npm install @sigma-studio/viewer`を実行する
44
+ 3. アプリのentry pointで`@sigma-studio/viewer/styles.css`を一度だけ読み込む
45
+ 4. APIや保存層から受け取る`unknown`値を`parseSigmaDocument`で検証する
46
+ 5. 検証済みの`SigmaDocument`を`SigmaDocViewer`の`document`へ渡す
47
+ 6. ホスト側のtypecheckとbuildを実行する
48
+
49
+ 独自のHTML変換やTiptap変換を間に挟まず、SigmaDoc JSONを表示の正本にしてください。Viewer内部のDOM、CSS class、canvas状態には依存せず、公開されているpropsだけを使用します。
50
+
51
+ 次の指示をそのままAIエージェントへ渡せます。
52
+
53
+ ```text
54
+ このReactプロジェクトへ @sigma-studio/viewer を導入してください。
55
+
56
+ 要件:
57
+ - 既存のpackage managerとReact構成を確認し、@sigma-studio/viewerを追加する
58
+ - @sigma-studio/viewer/styles.cssをアプリ全体で一度だけ読み込む
59
+ - 外部から取得した教材JSONはparseSigmaDocumentで検証する
60
+ - 検証済みSigmaDocumentをSigmaDocViewerのdocument propへ渡す
61
+ - Viewerにfetch、保存、認証の責務を持たせない
62
+ - SigmaDoc JSONを正本とし、HTMLやTiptap JSONへ永続化しない
63
+ - 内部moduleや内部CSS classをimportしない
64
+ - 既存UIに合わせた必要最小限のcontainerだけ追加する
65
+ - 実装後にtypecheckとproduction buildを実行し、変更ファイルと検証結果を報告する
66
+ ```
67
+
38
68
  ## API
39
69
 
40
70
  ### `SigmaDocViewer`
@@ -101,7 +131,6 @@ PNG、JPEG、WebPはbase64形式と実ファイル署名を検証します。SVG
101
131
 
102
132
  以下はこのリポジトリの開発者向けコマンドです。リポジトリルートで実行します。
103
133
 
104
-
105
134
  ```sh
106
135
  npm run viewer:typecheck
107
136
  npm run viewer:test
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@sigma-studio/viewer",
3
- "version": "0.188.0",
3
+ "version": "0.188.2",
4
4
  "description": "Read-only React renderer for SigmaDoc teaching materials.",
5
+ "keywords": [
6
+ "sigma-studio",
7
+ "sigmadoc",
8
+ "react",
9
+ "math",
10
+ "education",
11
+ "viewer"
12
+ ],
5
13
  "license": "MIT",
6
14
  "repository": {
7
15
  "type": "git",