@kubohiroya/turbowarp-extension-data-editor 0.3.3 → 0.3.4

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.ja.md ADDED
@@ -0,0 +1,157 @@
1
+ # turbowarp-extension-data-editor
2
+
3
+ [English](README.md) | 日本語
4
+
5
+ TurboWarp拡張が扱う構造化データを、フォームや独自UIで編集するための実験的な共通API v1です。
6
+ [共通基盤 #1](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/1) と
7
+ [GUI 接続 #1](https://github.com/kubohiroya/scratch-gui/issues/1) に対応します。
8
+
9
+ 日本語の利用手順・API・GUI接続・公開・検証記録は[ドキュメント一覧](docs/README.md)へ集約しています。
10
+
11
+ タブ・グループ・グリッドは[共通レイアウトガイド](docs/common-layout.ja.md)を参照してください。標準RJSFとSource/Formで同じJSON宣言を使用し、ホストの起動時フラグ `commonLayout` で有効にします(既定OFF)。
12
+
13
+ [公開エディター・日英案内](https://kubohiroya.github.io/turbowarp-extension-data-editor/) と
14
+ [公開・検証の運用Issue #26](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/26) も本リポジトリが所有します。
15
+
16
+ ## 標準の JSON Schema エディター
17
+
18
+ JSON/YAML を格納する文字列引数と JSON Schema を宣言すると、react-jsonschema-form がフォームを生成します。
19
+ GUI の登録 API は `schema` を検出して標準エディターを選びます。本文 UI の実装は不要です。
20
+
21
+ ```js
22
+ const unregister = Scratch.gui.blockEditors.register({
23
+ apiVersion: 1,
24
+ extensionId: 'story',
25
+ editorId: 'properties',
26
+ opcodes: ['story_scene'],
27
+ argument: 'PROPERTIES',
28
+ format: 'yaml', // Omit for JSON compatibility.
29
+ schema: {
30
+ type: 'object',
31
+ properties: {
32
+ label: {type: 'string', minLength: 1, title: '名前'},
33
+ duration: {type: 'number', minimum: 1, maximum: 60, title: '秒数'}
34
+ },
35
+ required: ['label', 'duration'],
36
+ additionalProperties: false
37
+ },
38
+ uiSchema: {'ui:order': ['label', 'duration']}
39
+ });
40
+ ```
41
+
42
+ `registerSchema()` も同じ標準エディターを明示的に登録できます。
43
+ 必須項目・型・範囲などの検証エラーがある間は保存ボタンを無効化し、保存時にも必ず再検証します。
44
+ 任意の非同期 `validateData(data, snapshot)` による業務検証は保存時に追加実行されます。
45
+ スキーマの検証は AJV 8、描画は React 16.14 に対応する RJSF 5.24.13 を使用します。
46
+ 対応の基本は JSON Schema draft-07 とローカル参照です。外部参照の取得は行わず、解決できない参照は登録時に拒否します。
47
+ `default` は下書きへ補完し、保存するまで元ブロックへ書き込みません。
48
+
49
+ `format: 'json' | 'yaml'` を指定できます。省略時は従来どおり JSON です。
50
+ YAML はホスト側の `yaml` 2.x で単一の YAML 1.2 core 文書を decode し、
51
+ JSON と同じ Schema で検証した後、指定形式で encode します。
52
+ 文字列キーの mapping、sequence、有限数値・文字列・真偽値・null が対象です。
53
+ 重複キー、非文字列キー、独自 tag、非有限数値、循環 alias、複数文書、YAML 1.1 は拒否し、元の引数は変更しません。
54
+ 非循環 alias は制限付きで展開します。merge key の特別な展開は行いません。
55
+ 変更なしの保存はコメント・空白を含む元文字列を保持し、commit しません。
56
+ 変更がある保存はデータの意味を保持して再出力しますが、コメント・引用符・anchor・キー順の保持は保証しません。
57
+ フォームで編集しない追加プロパティも、Schema が許可する限り保持します。
58
+ GUIのwebpack 4接続では[互換配布物と設定API](docs/webpack4.md)を使い、RJSF/YAMLの変換を本パッケージ側で行います。
59
+
60
+ ## API とトランザクション
61
+
62
+ ルートの `EditorRegistry` / `EditorSession` は React / Blockly に依存しません。
63
+ `@kubohiroya/turbowarp-extension-data-editor/rjsf` の `createSchemaEditor()` が標準フォームを提供します。
64
+ 通常 DOM や独自 React UI の `mount()` を持つ定義も登録できます。
65
+ `/rjsf` の `createBlockEditorService()` がSchema検出・登録/解除・通知を提供します。
66
+ `/react` の `BlockEditorDialog` は保存/キャンセル・エラー・階層UIを提供し、ホストのModal・翻訳・テーマを注入します。
67
+ CSSは `/react/styles.css` をホストのCSS Modules経由で読み込みます。
68
+
69
+ 開始時のスナップショットと独立した JSON の下書きを持ち、キャンセルでは変更を破棄します。
70
+ 保存は検証、引数の許可リスト、reporter 保護、競合確認を通し、ホストへ1回だけ変更を要求します。
71
+ GUI ホストは画面と VM を同期し、保存を Undo/Redo 各1回にまとめます。失敗時の復元もホストの責務です。
72
+ `session.reference` で対象の target / block を識別できます。本文の unmount は下書きとエラーを保持し、再マウントできます。
73
+ 解除済みビューからの更新を拒否し、ビューの購読を解放します。標準フォームのフィールド ID も各表示で分離します。
74
+ 詳しくは [API とホスト契約](docs/api.md) を参照してください。
75
+
76
+ ## TurboWarp 接続
77
+
78
+ `/turbowarp` の `attachTurboWarpBlockEditors()` にホストのScratchBlocks / VM / workspace、
79
+ 登録サービスと画面コールバックを渡すと、アイコン装飾・セッション起動・VM同期・一括保存を接続します。
80
+ `enabled` / `descendants` は省略時OFF、戻り値は `refresh()` / 冪等な `dispose()` です。
81
+ GUIにはライフサイクル・Modal/翻訳/テーマの接続を残します。
82
+ 詳細は [TurboWarp アダプターAPI](docs/turbowarp-adapter.md) を参照してください。
83
+
84
+ ## 子孫をまとめる階層セッション
85
+
86
+ [共通基盤 #2](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/2) の追加 API として、
87
+ `EditorRegistry.openDescendants()` と `DescendantSession` を提供します。
88
+ ホストが `descendant-editing-v1` capability と完全な subtree snapshot / 一括 commit を提供する場合だけ使用します。
89
+ 既存の API v1 の本文を再利用し、親子孫・複数枝の下書きと検証結果を保持して、全変更を1回でホストへ渡します。
90
+ 未登録の中間ノードを構造として保持し、非表示ノードも検証します。構造・値・登録の競合、上限超過、非同期処理中の無効化に対応します。
91
+
92
+ 上限は500ノード・深さ32。GUIは階層編集を標準で提供し、未対応ホストでは既存の単一編集を使います。
93
+ 詳細と業務非依存サンプルは [階層セッションの契約](docs/descendants.md) を参照してください。
94
+ 実 GUI の探索・階層モーダル・一括 Undo/Redo・`.sb3` 結合確認は scratch-gui #2 での接続が必要です。
95
+
96
+ ## ローカル検証
97
+
98
+ Node.js 22.18 以降と pnpm を使用します。
99
+
100
+ ```sh
101
+ pnpm install
102
+ pnpm typecheck
103
+ pnpm test
104
+ ```
105
+
106
+ `pnpm test` は型宣言を含むビルド後、コアと標準フォームのテストを実行します。
107
+ パッケージは ESM です。ブラウザには ES2022 の組み込み API が必要です。
108
+ 標準フォームの React / ReactDOM peer は 16.14 / 17 / 18。GUI は既存の 16.14 を共有します。
109
+ 初回の実験版は `@kubohiroya/turbowarp-extension-data-editor@0.1.0` です。固定SchemaのSource/Form編集は `0.2.0`、既定OFFの固定入力契約・標準field transaction・固定フォームとGUI接続は `0.2.1` で追加しました。配布版 `0.2.2` は、編集見出しのブロック名・アイコン、項目の削除メニュー・追加ボタン、key-valueの2行表示を含みます。
110
+
111
+ ```sh
112
+ npm install --save-exact @kubohiroya/turbowarp-extension-data-editor@0.2.2
113
+ ```
114
+
115
+ 配布物・改名時の互換性・公開手順は[パッケージ配布](docs/package-distribution.md)を参照してください。
116
+
117
+ ## GUI で試す
118
+
119
+ `scratch-gui` は本パッケージを検証済みのnpm完全version、またはGitの完全SHAで固定参照します。通常のGUIビルドに共通リポジトリの隣接配置は不要です。
120
+ [GUIの起動・制約・検証手順](docs/block-editor.md) に従ってください。
121
+ 既存の拡張アイコンをクリックすると、標準モーダルで下書きを編集できます。
122
+
123
+ 既存のSOURCE経路は、配置済みブロックの通常の text shadow に保存された JSON/YAML 文字列を扱います。この経路でreporter、メニュー、独自validator付きfieldを書き換えません。固定入力経路は対応hostで静的menu・数値・色を扱い、reporterや動的menuを評価・置換しません。
124
+ `.sb3` の保存、`project_url` とOSのファイル選択による再読込、日英表示とテーマの検証手順・実行範囲は[GUI接続E2E](docs/block-editor-e2e.md)と[固定入力の契約](docs/fixed-input-contracts.md)を参照してください。
125
+
126
+ ## 標準動作とロールバック
127
+
128
+ 対応GUIはダイアログ、ソースフォーム、共通レイアウト、固定入力、子孫編集、一括セキュリティ確認を標準で提供します。
129
+ 通常の `editor.html?lang=ja` で利用でき、有効化用URLスイッチは不要です。低水準APIのhost能力交渉は維持します。
130
+ 切戻しはGUIの変更と公開ページのGUI pinを一組でrevertします。
131
+ 確定値は既存引数へ保存し、UI・下書き・関数・revision をプロジェクトデータへ追加しません。
132
+
133
+ ## webpack 4 / E2E
134
+
135
+ [webpack 4配布物と設定API](docs/webpack4.md)、[GUI接続E2EとCIの実行手順](docs/block-editor-e2e.md)を参照。専用編集UIから互換ビルド・E2Eまで共通側で管理し、GUIには明示的なホスト接続とCI呼出しを残す。
136
+
137
+ ## Schemaの共通型と診断変換
138
+
139
+ `@kubohiroya/turbowarp-extension-data-editor/schema`はDOM・React・RJSFをロードせずに利用できる入口です。Schema bundle、正本・生成物・参照用の役割、処理段階別の診断・結果、同期owner検証の型を公開します。
140
+
141
+ `toValidationIssues()`は入力診断を既存の`ValidationIssue`へ変換し、JSON Pointerのpath・順序・件数を維持した凍結結果を返します。不正な診断やcompile/execution診断はTypeErrorで拒否します。既存RJSFのpathや保存時専用の非同期`validateData`の契約は変わりません。
142
+
143
+ `compileSchemaBundle()`はdraft-07/2020-12と同梱resourceからオフラインの同期validatorを生成します。Schemaと入力を変更せず、構造化診断を返します。[pure検証API](docs/schema.md)を参照してください。同期owner合成と明示bundleのRJSF経路も追加済みです。既存公開入口・webpack4/build-info・CSS buildを維持しています。
144
+
145
+ 同期owner検証には`/schema`の`validateSchemaInput`を利用できます。明示bundleフォームは`/rjsf`の`createSchemaBundleEditor` / `registerSchemaBundle`で登録します。context providerは呼出しごとに時刻・設定を渡します。表示上の対応範囲と既存APIの扱いは[Schema基盤](docs/schema.md)を参照してください。
146
+
147
+ 既存SOURCE契約の導入時に採取した横断検証記録は**14契約・8 package**です。[Template分離後の再検証手順](docs/template-fixture-separation.ja.md#current-verification)で、Templateを含まないisolation indexと2つの検証commandを確認してください。この導入時記録では14本番契約と9固定契約を区別しています。固定入力の実装・GUI接続は末尾の契約節を参照してください。旧16契約・9 packageの結果と当時の開始条件は[段階1の履歴](docs/schema-stage1.ja.md)として保持します。
148
+
149
+ ## Optional editing examples
150
+
151
+ Repository examples are opt-in teaching code, not template blocks or additional package exports. See [the JSON/YAML document example](examples/document-properties.mjs) and [its guide](examples/README.ja.md). Each extension owns its actual data contract.
152
+
153
+ Prepared source editing is an optional host capability. See [the source/form contract](docs/source-forms.ja.md) for fixed-schema bindings, atomic saves, compatibility, and rollback.
154
+
155
+ ## 固定入力とGUI接続(S3-1〜S3-3)
156
+
157
+ 固定入力の型・Schema検査・同期prepared契約を追加しています。`createBlockEditorService({fixedInputs: true})`の明示時だけ新しい登録APIを提供し、対応hostがない場合は開けません。lower-level hostの`enableFixedInputs: true`で標準fieldの読取・原子的保存を利用できます。固定フォームとGUIの既定OFFフラグ接続も含みます。各拡張は正本Schema・codec・登録を所有します。[固定入力の契約](docs/fixed-input-contracts.md)を参照してください。配布物には元Git SHAと版更新を含むworking-tree release overlayの区分を記録しています。
package/README.md CHANGED
@@ -1,20 +1,22 @@
1
1
  # turbowarp-extension-data-editor
2
2
 
3
- TurboWarp拡張が扱う構造化データを、フォームや独自UIで編集するための実験的な共通API v1です。
4
- [共通基盤 #1](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/1) と
5
- [GUI 接続 #1](https://github.com/kubohiroya/scratch-gui/issues/1) に対応します。
3
+ English | [日本語](README.ja.md)
6
4
 
7
- 日本語の利用手順・API・GUI接続・公開・検証記録は[ドキュメント一覧](docs/README.md)へ集約しています。
5
+ An experimental shared API v1 for editing structured data used by TurboWarp extensions through forms and custom UIs.
6
+ This package implements [shared infrastructure #1](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/1) and
7
+ [GUI integration #1](https://github.com/kubohiroya/scratch-gui/issues/1).
8
8
 
9
- タブ・グループ・グリッドは[共通レイアウトガイド](docs/common-layout.ja.md)を参照してください。標準RJSFとSource/Formで同じJSON宣言を使用し、ホストの起動時フラグ `commonLayout` で有効にします(既定OFF)。
9
+ Japanese guides for usage, APIs, GUI integration, publishing, and validation records are collected in the [documentation index](docs/README.md).
10
10
 
11
- [公開エディター・日英案内](https://kubohiroya.github.io/turbowarp-extension-data-editor/) と
12
- [公開・検証の運用Issue #26](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/26) も本リポジトリが所有します。
11
+ For tabs, groups, and grids, see the [shared layout guide (Japanese)](docs/common-layout.ja.md). Standard RJSF and Source/Form use the same JSON declarations, enabled by the host's startup flag `commonLayout` (off by default).
13
12
 
14
- ## 標準の JSON Schema エディター
13
+ This repository also owns the [public editor and English/Japanese guides](https://kubohiroya.github.io/turbowarp-extension-data-editor/) and
14
+ [deployment and validation tracking issue #26](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/26).
15
15
 
16
- JSON/YAML を格納する文字列引数と JSON Schema を宣言すると、react-jsonschema-form がフォームを生成します。
17
- GUI の登録 API は `schema` を検出して標準エディターを選びます。本文 UI の実装は不要です。
16
+ ## Standard JSON Schema editor
17
+
18
+ Declare a string argument containing JSON/YAML and a JSON Schema, and react-jsonschema-form generates the form.
19
+ The GUI registration API detects `schema` and selects the standard editor. No custom editor body is needed.
18
20
 
19
21
  ```js
20
22
  const unregister = Scratch.gui.blockEditors.register({
@@ -27,8 +29,8 @@ const unregister = Scratch.gui.blockEditors.register({
27
29
  schema: {
28
30
  type: 'object',
29
31
  properties: {
30
- label: {type: 'string', minLength: 1, title: '名前'},
31
- duration: {type: 'number', minimum: 1, maximum: 60, title: '秒数'}
32
+ label: {type: 'string', minLength: 1, title: 'Name'},
33
+ duration: {type: 'number', minimum: 1, maximum: 60, title: 'Seconds'}
32
34
  },
33
35
  required: ['label', 'duration'],
34
36
  additionalProperties: false
@@ -37,63 +39,63 @@ const unregister = Scratch.gui.blockEditors.register({
37
39
  });
38
40
  ```
39
41
 
40
- `registerSchema()` も同じ標準エディターを明示的に登録できます。
41
- 必須項目・型・範囲などの検証エラーがある間は保存ボタンを無効化し、保存時にも必ず再検証します。
42
- 任意の非同期 `validateData(data, snapshot)` による業務検証は保存時に追加実行されます。
43
- スキーマの検証は AJV 8、描画は React 16.14 に対応する RJSF 5.24.13 を使用します。
44
- 対応の基本は JSON Schema draft-07 とローカル参照です。外部参照の取得は行わず、解決できない参照は登録時に拒否します。
45
- `default` は下書きへ補完し、保存するまで元ブロックへ書き込みません。
46
-
47
- `format: 'json' | 'yaml'` を指定できます。省略時は従来どおり JSON です。
48
- YAML はホスト側の `yaml` 2.x で単一の YAML 1.2 core 文書を decode し、
49
- JSON と同じ Schema で検証した後、指定形式で encode します。
50
- 文字列キーの mapping、sequence、有限数値・文字列・真偽値・null が対象です。
51
- 重複キー、非文字列キー、独自 tag、非有限数値、循環 alias、複数文書、YAML 1.1 は拒否し、元の引数は変更しません。
52
- 非循環 alias は制限付きで展開します。merge key の特別な展開は行いません。
53
- 変更なしの保存はコメント・空白を含む元文字列を保持し、commit しません。
54
- 変更がある保存はデータの意味を保持して再出力しますが、コメント・引用符・anchor・キー順の保持は保証しません。
55
- フォームで編集しない追加プロパティも、Schema が許可する限り保持します。
56
- GUIのwebpack 4接続では[互換配布物と設定API](docs/webpack4.md)を使い、RJSF/YAMLの変換を本パッケージ側で行います。
57
-
58
- ## API とトランザクション
59
-
60
- ルートの `EditorRegistry` / `EditorSession` は React / Blockly に依存しません。
61
- `@kubohiroya/turbowarp-extension-data-editor/rjsf` の `createSchemaEditor()` が標準フォームを提供します。
62
- 通常 DOM や独自 React UI の `mount()` を持つ定義も登録できます。
63
- `/rjsf` の `createBlockEditorService()` がSchema検出・登録/解除・通知を提供します。
64
- `/react` の `BlockEditorDialog` は保存/キャンセル・エラー・階層UIを提供し、ホストのModal・翻訳・テーマを注入します。
65
- CSSは `/react/styles.css` をホストのCSS Modules経由で読み込みます。
66
-
67
- 開始時のスナップショットと独立した JSON の下書きを持ち、キャンセルでは変更を破棄します。
68
- 保存は検証、引数の許可リスト、reporter 保護、競合確認を通し、ホストへ1回だけ変更を要求します。
69
- GUI ホストは画面と VM を同期し、保存を Undo/Redo 各1回にまとめます。失敗時の復元もホストの責務です。
70
- `session.reference` で対象の target / block を識別できます。本文の unmount は下書きとエラーを保持し、再マウントできます。
71
- 解除済みビューからの更新を拒否し、ビューの購読を解放します。標準フォームのフィールド ID も各表示で分離します。
72
- 詳しくは [API とホスト契約](docs/api.md) を参照してください。
73
-
74
- ## TurboWarp 接続
75
-
76
- `/turbowarp` の `attachTurboWarpBlockEditors()` にホストのScratchBlocks / VM / workspace、
77
- 登録サービスと画面コールバックを渡すと、アイコン装飾・セッション起動・VM同期・一括保存を接続します。
78
- `enabled` / `descendants` は省略時OFF、戻り値は `refresh()` / 冪等な `dispose()` です。
79
- GUIにはライフサイクル・Modal/翻訳/テーマの接続を残します。
80
- 詳細は [TurboWarp アダプターAPI](docs/turbowarp-adapter.md) を参照してください。
81
-
82
- ## 子孫をまとめる階層セッション
83
-
84
- [共通基盤 #2](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/2) の追加 API として、
85
- `EditorRegistry.openDescendants()` と `DescendantSession` を提供します。
86
- ホストが `descendant-editing-v1` capability と完全な subtree snapshot / 一括 commit を提供する場合だけ使用します。
87
- 既存の API v1 の本文を再利用し、親子孫・複数枝の下書きと検証結果を保持して、全変更を1回でホストへ渡します。
88
- 未登録の中間ノードを構造として保持し、非表示ノードも検証します。構造・値・登録の競合、上限超過、非同期処理中の無効化に対応します。
89
-
90
- 上限は500ノード・深さ32。GUIは階層編集を標準で提供し、未対応ホストでは既存の単一編集を使います。
91
- 詳細と業務非依存サンプルは [階層セッションの契約](docs/descendants.md) を参照してください。
92
- 実 GUI の探索・階層モーダル・一括 Undo/Redo・`.sb3` 結合確認は scratch-gui #2 での接続が必要です。
93
-
94
- ## ローカル検証
95
-
96
- Node.js 22.18 以降と pnpm を使用します。
42
+ `registerSchema()` can also register the standard editor explicitly.
43
+ The Save button is disabled while validation errors exist, including missing required fields, invalid types, or out-of-range values. Data is always validated again when saving.
44
+ An optional asynchronous `validateData(data, snapshot)` adds business validation at save time.
45
+ Schema validation uses AJV 8; rendering uses RJSF 5.24.13, compatible with React 16.14.
46
+ The baseline supports JSON Schema draft-07 and local references. External references are never fetched, and unresolved references are rejected during registration.
47
+ Schema `default` values populate the draft without writing to the original block until saving.
48
+
49
+ Set `format: 'json' | 'yaml'`; omitting it preserves the existing JSON behavior.
50
+ For YAML, the host's `yaml` 2.x decodes a single YAML 1.2 core document,
51
+ validates it against the same Schema as JSON, and encodes it in the specified format.
52
+ Supported values are mappings with string keys, sequences, finite numbers, strings, booleans, and null.
53
+ Duplicate keys, non-string keys, custom tags, non-finite numbers, cyclic aliases, multiple documents, and YAML 1.1 are rejected without changing the original argument.
54
+ Non-cyclic aliases are expanded within limits. Merge keys receive no special expansion.
55
+ Saving unchanged data preserves the original string, including comments and whitespace, without committing.
56
+ Saving changed data preserves its meaning, but does not guarantee preservation of comments, quoting, anchors, or key order.
57
+ Additional properties outside the form are retained whenever the Schema permits them.
58
+ For GUI integration with webpack 4, use the [compatibility distribution and configuration API (Japanese)](docs/webpack4.md); this package handles RJSF/YAML transpilation.
59
+
60
+ ## API and transactions
61
+
62
+ The root `EditorRegistry` / `EditorSession` APIs have no React or Blockly dependency.
63
+ `createSchemaEditor()` from `@kubohiroya/turbowarp-extension-data-editor/rjsf` provides the standard form.
64
+ You can also register definitions with a `mount()` implementation using plain DOM or a custom React UI.
65
+ `createBlockEditorService()` from `/rjsf` provides Schema detection, registration, unregistration, and notifications.
66
+ `BlockEditorDialog` from `/react` provides Save/Cancel controls, errors, and a hierarchical UI, with the host injecting its Modal, translations, and theme.
67
+ Load `/react/styles.css` through the host's CSS Modules configuration.
68
+
69
+ Each session holds an initial snapshot and an independent JSON draft. Canceling discards changes.
70
+ Saving passes validation, an argument allowlist, reporter protection, and conflict checks before requesting a single change from the host.
71
+ The GUI host synchronizes the workspace and VM, grouping the save into one Undo/Redo step. The host also restores state on failure.
72
+ `session.reference` identifies the target and block. Unmounting the editor body preserves the draft and errors for remounting.
73
+ Updates from detached views are rejected, view subscriptions are released, and standard form field IDs are isolated per view.
74
+ See the [API and host contract (Japanese)](docs/api.md) for details.
75
+
76
+ ## TurboWarp integration
77
+
78
+ Pass the host's ScratchBlocks, VM, workspace, registration service, and UI callbacks to
79
+ `attachTurboWarpBlockEditors()` from `/turbowarp` to connect icon decorations, session opening, VM synchronization, and batch saves.
80
+ `enabled` / `descendants` default to off; the returned object provides `refresh()` and an idempotent `dispose()`.
81
+ The GUI remains responsible for lifecycle management and connecting its Modal, translations, and theme.
82
+ See the [TurboWarp adapter API (Japanese)](docs/turbowarp-adapter.md).
83
+
84
+ ## Hierarchical sessions for descendants
85
+
86
+ As an additional API for [shared infrastructure #2](https://github.com/kubohiroya/turbowarp-extension-data-editor/issues/2),
87
+ the package provides `EditorRegistry.openDescendants()` and `DescendantSession`.
88
+ Use them only when the host provides the `descendant-editing-v1` capability, a complete subtree snapshot, and batch commits.
89
+ They reuse existing API v1 editor bodies, retain drafts and validation results across parents, descendants, and multiple branches, and pass all changes to the host in one operation.
90
+ Unregistered intermediate nodes remain in the structure, and hidden nodes are also validated. Sessions handle structural, value, and registration conflicts, limits, and invalidation during asynchronous operations.
91
+
92
+ Limits are 500 nodes and a depth of 32. The GUI provides hierarchical editing by default, falling back to existing single-block editing on unsupported hosts.
93
+ See the [hierarchical session contract (Japanese)](docs/descendants.md) for details and domain-independent examples.
94
+ Real GUI traversal, hierarchical modals, batch Undo/Redo, and `.sb3` integration checks require the integration tracked in scratch-gui #2.
95
+
96
+ ## Local validation
97
+
98
+ Use Node.js 22.18 or later and pnpm.
97
99
 
98
100
  ```sh
99
101
  pnpm install
@@ -101,55 +103,55 @@ pnpm typecheck
101
103
  pnpm test
102
104
  ```
103
105
 
104
- `pnpm test` は型宣言を含むビルド後、コアと標準フォームのテストを実行します。
105
- パッケージは ESM です。ブラウザには ES2022 の組み込み API が必要です。
106
- 標準フォームの React / ReactDOM peer は 16.14 / 17 / 18。GUI は既存の 16.14 を共有します。
107
- 初回の実験版は `@kubohiroya/turbowarp-extension-data-editor@0.1.0` です。固定SchemaのSource/Form編集は `0.2.0`、既定OFFの固定入力契約・標準field transaction・固定フォームとGUI接続は `0.2.1` で追加しました。配布版 `0.2.2` は、編集見出しのブロック名・アイコン、項目の削除メニュー・追加ボタン、key-valueの2行表示を含みます。
106
+ `pnpm test` builds the package, including type declarations, then runs the core and standard form tests.
107
+ The package uses ESM. Browsers need ES2022 built-in APIs.
108
+ The standard form supports React / ReactDOM peers 16.14, 17, and 18. The GUI shares its existing React 16.14 installation.
109
+ The first experimental release was `@kubohiroya/turbowarp-extension-data-editor@0.1.0`. Fixed-schema Source/Form editing was added in `0.2.0`; default-off fixed-input contracts, standard field transactions, fixed-input forms, and GUI integration followed in `0.2.1`. Release `0.2.2` includes block names and icons in editor headings, field removal menus and add buttons, and two-line key-value layouts.
108
110
 
109
111
  ```sh
110
112
  npm install --save-exact @kubohiroya/turbowarp-extension-data-editor@0.2.2
111
113
  ```
112
114
 
113
- 配布物・改名時の互換性・公開手順は[パッケージ配布](docs/package-distribution.md)を参照してください。
115
+ See [package distribution (Japanese)](docs/package-distribution.md) for artifacts, compatibility after renaming, and publishing procedures.
114
116
 
115
- ## GUI で試す
117
+ ## Try it in the GUI
116
118
 
117
- `scratch-gui` は本パッケージを検証済みのnpm完全version、またはGitの完全SHAで固定参照します。通常のGUIビルドに共通リポジトリの隣接配置は不要です。
118
- [GUIの起動・制約・検証手順](docs/block-editor.md) に従ってください。
119
- 既存の拡張アイコンをクリックすると、標準モーダルで下書きを編集できます。
119
+ `scratch-gui` pins this package to a validated exact npm version or a full Git SHA. Normal GUI builds do not require an adjacent checkout of this shared repository.
120
+ Follow the [GUI startup, limitations, and validation guide (Japanese)](docs/block-editor.md).
121
+ Click an existing extension icon to edit a draft in the standard modal.
120
122
 
121
- 既存のSOURCE経路は、配置済みブロックの通常の text shadow に保存された JSON/YAML 文字列を扱います。この経路でreporter、メニュー、独自validator付きfieldを書き換えません。固定入力経路は対応hostで静的menu・数値・色を扱い、reporterや動的menuを評価・置換しません。
122
- `.sb3` の保存、`project_url` とOSのファイル選択による再読込、日英表示とテーマの検証手順・実行範囲は[GUI接続E2E](docs/block-editor-e2e.md)と[固定入力の契約](docs/fixed-input-contracts.md)を参照してください。
123
+ The existing SOURCE path handles JSON/YAML strings stored in ordinary text shadows on blocks already placed in the workspace. This path does not modify reporters, menus, or fields with custom validators. On supported hosts, the fixed-input path handles static menus, numbers, and colors without evaluating or replacing reporters or dynamic menus.
124
+ For `.sb3` saving, reloading through `project_url` and the OS file picker, English/Japanese display, themes, and the scope of validation, see [GUI integration E2E (Japanese)](docs/block-editor-e2e.md) and the [fixed-input contract (Japanese)](docs/fixed-input-contracts.md).
123
125
 
124
- ## 標準動作とロールバック
126
+ ## Default behavior and rollback
125
127
 
126
- 対応GUIはダイアログ、ソースフォーム、共通レイアウト、固定入力、子孫編集、一括セキュリティ確認を標準で提供します。
127
- 通常の `editor.html?lang=ja` で利用でき、有効化用URLスイッチは不要です。低水準APIのhost能力交渉は維持します。
128
- 切戻しはGUIの変更と公開ページのGUI pinを一組でrevertします。
129
- 確定値は既存引数へ保存し、UI・下書き・関数・revision をプロジェクトデータへ追加しません。
128
+ Supported GUIs provide dialogs, source forms, shared layouts, fixed inputs, descendant editing, and batch security confirmation by default.
129
+ These are available at the normal `editor.html?lang=ja` URL without activation switches. Low-level API host capability negotiation remains in place.
130
+ To roll back, revert the GUI changes together with the public page's GUI pin.
131
+ Committed values are stored in existing arguments. UI state, drafts, functions, and revisions are not added to project data.
130
132
 
131
133
  ## webpack 4 / E2E
132
134
 
133
- [webpack 4配布物と設定API](docs/webpack4.md)、[GUI接続E2EとCIの実行手順](docs/block-editor-e2e.md)を参照。専用編集UIから互換ビルド・E2Eまで共通側で管理し、GUIには明示的なホスト接続とCI呼出しを残す。
135
+ See the [webpack 4 distribution and configuration API (Japanese)](docs/webpack4.md) and [GUI integration E2E and CI procedures (Japanese)](docs/block-editor-e2e.md). This shared repository manages the custom editor UI, compatibility builds, and E2E tests; the GUI retains explicit host integration and CI calls.
134
136
 
135
- ## Schemaの共通型と診断変換
137
+ ## Shared Schema types and diagnostic conversion
136
138
 
137
- `@kubohiroya/turbowarp-extension-data-editor/schema`はDOM・React・RJSFをロードせずに利用できる入口です。Schema bundle、正本・生成物・参照用の役割、処理段階別の診断・結果、同期owner検証の型を公開します。
139
+ `@kubohiroya/turbowarp-extension-data-editor/schema` is an entry point that loads no DOM, React, or RJSF code. It exports types for Schema bundles, authoritative/generated/reference roles, diagnostics and results by processing stage, and synchronous owner validation.
138
140
 
139
- `toValidationIssues()`は入力診断を既存の`ValidationIssue`へ変換し、JSON Pointerのpath・順序・件数を維持した凍結結果を返します。不正な診断やcompile/execution診断はTypeErrorで拒否します。既存RJSFのpathや保存時専用の非同期`validateData`の契約は変わりません。
141
+ `toValidationIssues()` converts input diagnostics into existing `ValidationIssue` values, returning frozen results that preserve JSON Pointer paths, ordering, and counts. Invalid diagnostics and compile/execution diagnostics are rejected with a TypeError. Existing RJSF paths and the save-time-only asynchronous `validateData` contract remain unchanged.
140
142
 
141
- `compileSchemaBundle()`はdraft-07/2020-12と同梱resourceからオフラインの同期validatorを生成します。Schemaと入力を変更せず、構造化診断を返します。[pure検証API](docs/schema.md)を参照してください。同期owner合成と明示bundleのRJSF経路も追加済みです。既存公開入口・webpack4/build-info・CSS buildを維持しています。
143
+ `compileSchemaBundle()` builds an offline synchronous validator from draft-07/2020-12 and bundled resources. It returns structured diagnostics without modifying the Schema or input. See the [pure validation API (Japanese)](docs/schema.md). Synchronous owner composition and an RJSF path for explicit bundles are also available. Existing public entry points, webpack4/build-info, and CSS builds are retained.
142
144
 
143
- 同期owner検証には`/schema`の`validateSchemaInput`を利用できます。明示bundleフォームは`/rjsf`の`createSchemaBundleEditor` / `registerSchemaBundle`で登録します。context providerは呼出しごとに時刻・設定を渡します。表示上の対応範囲と既存APIの扱いは[Schema基盤](docs/schema.md)を参照してください。
145
+ Use `validateSchemaInput` from `/schema` for synchronous owner validation. Register explicit-bundle forms with `createSchemaBundleEditor` / `registerSchemaBundle` from `/rjsf`. A context provider supplies the time and configuration for each call. See the [Schema infrastructure guide (Japanese)](docs/schema.md) for UI support and treatment of existing APIs.
144
146
 
145
- 既存SOURCE契約の導入時に採取した横断検証記録は**14契約・8 package**です。[Template分離後の再検証手順](docs/template-fixture-separation.ja.md#current-verification)で、Templateを含まないisolation indexと2つの検証commandを確認してください。この導入時記録では14本番契約と9固定契約を区別しています。固定入力の実装・GUI接続は末尾の契約節を参照してください。旧16契約・9 packageの結果と当時の開始条件は[段階1の履歴](docs/schema-stage1.ja.md)として保持します。
147
+ The cross-repository validation record collected when introducing the existing SOURCE contract covers **14 contracts across 8 packages**. See the [revalidation procedure after Template separation (Japanese)](docs/template-fixture-separation.ja.md#current-verification) for the isolation index excluding Template and the two validation commands. This introduction record distinguishes 14 production contracts from 9 fixed-input contracts. For fixed-input implementation and GUI integration, see the final contract section below. Earlier results for 16 contracts across 9 packages and their starting conditions are retained in the [stage 1 history (Japanese)](docs/schema-stage1.ja.md).
146
148
 
147
149
  ## Optional editing examples
148
150
 
149
- Repository examples are opt-in teaching code, not template blocks or additional package exports. See [the JSON/YAML document example](examples/document-properties.mjs) and [its guide](examples/README.ja.md). Each extension owns its actual data contract.
151
+ Repository examples are opt-in teaching code, not template blocks or additional package exports. See [the JSON/YAML document example](examples/document-properties.mjs) and [its guide (Japanese)](examples/README.ja.md). Each extension owns its actual data contract.
150
152
 
151
- Prepared source editing is an optional host capability. See [the source/form contract](docs/source-forms.ja.md) for fixed-schema bindings, atomic saves, compatibility, and rollback.
153
+ Prepared source editing is an optional host capability. See [the source/form contract (Japanese)](docs/source-forms.ja.md) for fixed-schema bindings, atomic saves, compatibility, and rollback.
152
154
 
153
- ## 固定入力とGUI接続(S3-1〜S3-3)
155
+ ## Fixed inputs and GUI integration (S3-1–S3-3)
154
156
 
155
- 固定入力の型・Schema検査・同期prepared契約を追加しています。`createBlockEditorService({fixedInputs: true})`の明示時だけ新しい登録APIを提供し、対応hostがない場合は開けません。lower-level hostの`enableFixedInputs: true`で標準fieldの読取・原子的保存を利用できます。固定フォームとGUIの既定OFFフラグ接続も含みます。各拡張は正本Schema・codec・登録を所有します。[固定入力の契約](docs/fixed-input-contracts.md)を参照してください。配布物には元Git SHAと版更新を含むworking-tree release overlayの区分を記録しています。
157
+ The package includes fixed-input types, Schema checks, and synchronous prepared contracts. New registration APIs are exposed only when explicitly setting `createBlockEditorService({fixedInputs: true})`, and editors cannot open without a compatible host. Setting `enableFixedInputs: true` on the lower-level host enables reading standard fields and saving atomically. Fixed-input forms and integration with the GUI's default-off flags are also included. Each extension owns its authoritative Schema, codec, and registration. See the [fixed-input contract (Japanese)](docs/fixed-input-contracts.md). Distribution artifacts record the original Git SHA separately from the working-tree release overlay that includes version updates.
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-extension-data-editor",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "repository": "https://github.com/kubohiroya/turbowarp-extension-data-editor",
5
- "revision": "33e98062cdab1952cb058a825924ff477c3e6e1c",
5
+ "revision": "4aae607614689771c1292f4eac863e2c45e49376",
6
6
  "sourceState": "commit",
7
- "sourceSha256": "3fae7ac7d1c10a1b24ddf591da899012d64f691eadf08a593cf0c704e523534b",
7
+ "sourceSha256": "4cde302bfaee610efdcff410fc405c24b73a427f329acb0b8105b2bc52fa59d1",
8
8
  "capabilities": {
9
9
  "preparedSource": 1
10
10
  }
@@ -10,7 +10,7 @@ import {
10
10
  sameFixedSnapshot,
11
11
  supportsFixedInputEditing,
12
12
  supportsFixedInputs
13
- } from "./shared-P2JBRZFP.js";
13
+ } from "./shared-QIOZ73LT.js";
14
14
  import {
15
15
  BlockEditorConflictError,
16
16
  BlockEditorStructureError,
@@ -22,7 +22,7 @@ import {
22
22
  } from "./shared-BKTRZUZH.js";
23
23
  import {
24
24
  parseFixedNumberInput
25
- } from "./shared-75QIWLZY.js";
25
+ } from "./shared-MX5ESFJ6.js";
26
26
  import "./shared-RN7GOT65.js";
27
27
  export {
28
28
  BlockEditorConflictError,