@kubohiroya/turbowarp-plus-editor-project-folder 0.3.0 → 0.5.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/README.ja.md +2 -2
- package/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +400 -313
- package/dist/session.d.ts +33 -0
- package/dist/source.d.ts +5 -0
- package/package.json +1 -1
- package/src/index.ts +41 -4
- package/src/session.ts +40 -0
- package/src/source.ts +58 -22
package/README.ja.md
CHANGED
|
@@ -10,7 +10,7 @@ TurboWarp Plus Editor で既存の sb3-toolchain v1 の作品フォルダを開
|
|
|
10
10
|
- `renderProjectFolderMenu(createElement, props)` は既存の開く・保存コマンドをホストのファイルメニューに渡します。
|
|
11
11
|
- 接続後の `openDirectory(handle, confirmReplace)` には、ホストが選択済みのディレクトリハンドルを渡せます。ファイルメニューと同じ作品検証・未保存編集の確認を経て開き、保存先にはその作品フォルダを使います。
|
|
12
12
|
|
|
13
|
-
ホストは VM、メニューコンポーネント、作品状態を扱うコールバックを渡します。メニューからフォルダを開くには、ブラウザーが File System Access
|
|
13
|
+
ホストは VM、メニューコンポーネント、作品状態を扱うコールバックを渡します。メニューからフォルダを開くには、ブラウザーが File System Access のフォルダ選択に対応している必要があります。保存で書き換えるのは作品データ(`project.source.json`)だけです。ブロック、変数・リスト、スプライトの位置や大きさなどの項目、モニター、組み込みの拡張機能の編集を保存し、作品の実行で変わった状態も含みます。スプライトの追加・削除・名前の変更と、コスチューム・音の追加・削除は、まだ保存しません。カスタム拡張機能・埋め込み拡張・フォントを含む作品は開けません。 [Editor #305](https://github.com/kubohiroya/turbowarp-plus-editor/issues/305) · [Editor #308](https://github.com/kubohiroya/turbowarp-plus-editor/issues/308)
|
|
14
14
|
|
|
15
15
|
## 外部変更
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ TurboWarp Plus Editor で既存の sb3-toolchain v1 の作品フォルダを開
|
|
|
20
20
|
| --- | --- |
|
|
21
21
|
| 未保存編集なし・実行停止中 | 2 回の確認でファイルが変わらなければ、既存のスプライトとステージのスクリプトの変更をその場で反映します。値と座標の変更はすべてのブロックを保ちます。ブロックの追加・削除・接続の変更は、ホストが `blockReload.deserializeBlocks` を渡す場合に、該当するスクリプトだけを置き換えます。 |
|
|
22
22
|
| 作品の実行中 | 反映を保留します。値と座標の変更は停止後に反映します。 |
|
|
23
|
-
| 未保存編集あり |
|
|
23
|
+
| 未保存編集あり | 編集を保持します。ホストが `blockReload.compareChanges` を渡す場合は、**比較して選ぶ…** で未保存の編集とフォルダでの変更を並べて示し、**編集を破棄してフォルダから読み込む** を選んだときだけ置き換えます。渡さない場合は、**編集を破棄して再読み込み…** で確認してから置き換えます。 |
|
|
24
24
|
| その他の変更(ターゲット・変数・コメントの変更、作品に無い変数や拡張機能を使うブロック、アセット・マニフェスト・拡張機能の変更) | **作品全体を再読み込み** で、開くときと同じ検証を経てフォルダを読み直します。自動では行いません。 |
|
|
25
25
|
| JSON の途中など書き込み途中 | 更新待ちを表示し、間を置かずに再確認します。 |
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ This package opens and saves existing sb3-toolchain v1 project folders in TurboW
|
|
|
10
10
|
- `renderProjectFolderMenu(createElement, props)` supplies the existing open and save commands to the host's file menu.
|
|
11
11
|
- The mounted session's `openDirectory(handle, confirmReplace)` accepts a directory handle already selected by the host. It uses the same project validation and unsaved-edit confirmation as the file menu. Save still targets the opened folder.
|
|
12
12
|
|
|
13
|
-
The host supplies the VM, menu components, and project state callbacks. The browser must support the File System Access picker for the built-in open command.
|
|
13
|
+
The host supplies the VM, menu components, and project state callbacks. The browser must support the File System Access picker for the built-in open command. Save writes the project file only: block, variable, list, sprite property, monitor and built-in extension edits are saved, including state that changes while the project runs. Adding, removing or renaming sprites, and adding or removing costumes and sounds, are not saved yet. Projects with custom extensions, embedded extensions or fonts cannot be opened. See [Editor issue #305](https://github.com/kubohiroya/turbowarp-plus-editor/issues/305) and [issue #308](https://github.com/kubohiroya/turbowarp-plus-editor/issues/308).
|
|
14
14
|
|
|
15
15
|
## External changes
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ When the host passes `host.blockReload`, the package checks the open folder ever
|
|
|
20
20
|
| --- | --- |
|
|
21
21
|
| No unsaved edits, project stopped | Once the file has stayed the same across two checks, changes to the scripts of existing sprites and the stage are applied in place. Value and position changes keep every block. Added, removed or reconnected blocks replace only the scripts they belong to, when the host passes `blockReload.deserializeBlocks`. |
|
|
22
22
|
| Project running | The change is held. Value and position changes apply when the project stops. |
|
|
23
|
-
| Unsaved edits | The edits are kept. **Discard Edits and Reload…** asks before replacing them
|
|
23
|
+
| Unsaved edits | The edits are kept. When the host passes `blockReload.compareChanges`, **Compare and Choose…** shows your unsaved edits next to the folder's changes, and the edits are replaced only if you choose **Discard Edits and Load from Folder**. Without it, **Discard Edits and Reload…** asks before replacing them. |
|
|
24
24
|
| Other changes: targets, variables, comments, blocks that need a variable or an extension the project lacks, assets, the manifest or extensions | **Reload Whole Project** reads the folder again with the same checks as opening it. This is never automatic. |
|
|
25
25
|
| Incomplete write, such as truncated JSON | The notice waits and the folder is checked again shortly. |
|
|
26
26
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FolderHost, FolderVM } from './session.js';
|
|
2
|
-
export type { FolderHost, FolderVM, OpenResult } from './session.js';
|
|
2
|
+
export type { Comparison, ComparisonRequest, ComparisonSection, FolderHost, FolderVM, OpenResult } from './session.js';
|
|
3
3
|
export type { ReloadTarget } from './block-reload.js';
|
|
4
4
|
export type { DeserializeBlocks } from './script-reload.js';
|
|
5
5
|
type MenuElement = (component: any, props: any, ...children: any[]) => any;
|