@kubohiroya/turbowarp-plus-editor 0.2.0-rc.1 → 0.2.0-rc.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.
package/README.md CHANGED
@@ -211,6 +211,6 @@ Use the landing page to create a project, open an SB3 URL, or continue to the ed
211
211
 
212
212
  ## ブロックアイコンのプレビュー
213
213
 
214
- [App rc.77のプレビュー体験サンプルを開く](https://kubohiroya.github.io/turbowarp-plus-editor/editor.html?lang=ja&twPlusBlockPreview=1&twPlusYamlEditor=1&project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-plus-editor%2Fsamples%2Fblock-preview%2Fblock-preview-rc77.sb3)。右下の「ステージ」→「コード」から、配置と動き・吹き出しの2シーンを試せます。[操作ガイド](https://kubohiroya.github.io/turbowarp-plus-editor/samples/block-preview/)・[SB3ダウンロード](https://kubohiroya.github.io/turbowarp-plus-editor/samples/block-preview/block-preview-rc77.sb3)も公開しています。正本は`site/samples/block-preview/`のYAML・SVGで、公開済みApp rc.77から`build:pages`時に再生成します。生成元・runtime・SB3のハッシュを配信`metadata.json`に記録し、Pagesの成果物チェックで照合します。
214
+ [App rc.77のプレビュー体験サンプルを開く](https://kubohiroya.github.io/turbowarp-plus-editor/editor.html?lang=ja&twPlusBlockPreview=1&twPlusYamlEditor=1&project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-plus-editor%2Fsamples%2Fblock-preview%2Fblock-preview-rc77.sb3)と、ステージの「コード」タブが自動的に開き、先頭のsceneが表示されます。配置と動き・吹き出しの2シーンをそのまま試せます。[操作ガイド](https://kubohiroya.github.io/turbowarp-plus-editor/samples/block-preview/)・[SB3ダウンロード](https://kubohiroya.github.io/turbowarp-plus-editor/samples/block-preview/block-preview-rc77.sb3)も公開しています。正本は`site/samples/block-preview/`のYAML・SVGで、公開済みApp rc.77から`build:pages`時に再生成します。生成元・runtime・SB3のハッシュを配信`metadata.json`に記録し、Pagesの成果物チェックで照合します。
215
215
 
216
216
  [プレビューを有効にしてEditorを開く](https://kubohiroya.github.io/turbowarp-plus-editor/?twPlusBlockPreview=1&twPlusYamlEditor=1)。既定OFFで、App rc.79の編集用runtimeとscene/actionを持つ作品が対象です。hover静止画、scene再生、アクターのドラッグ配置、moveTo/Bubbleのライブ再生に対応します。操作・既存作品の扱いは[利用案内](docs/block-icon-preview.md)を参照してください。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-plus-editor",
3
- "version": "0.2.0-rc.1",
3
+ "version": "0.2.0-rc.2",
4
4
  "description": "TurboWarp-Plus-Editorの配信、ブランド資産、作品を編集するボタン",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0-or-later",
@@ -63,7 +63,7 @@
63
63
  "@turbowarp/jszip": "^3.12.0",
64
64
  "@turbowarp/packager": "3.14.0",
65
65
  "@kubohiroya/turbowarp-embedded-yaml": "0.1.0-rc.2",
66
- "@kubohiroya/turbowarp-extension-data-editor": "0.6.0",
66
+ "@kubohiroya/turbowarp-extension-data-editor": "0.7.0",
67
67
  "@kubohiroya/turbowarp-kamishibai-app": "4.0.0-rc.79",
68
68
  "@kubohiroya/turbowarp-kamishibai-preview-app": "npm:@kubohiroya/turbowarp-kamishibai-app@4.0.0-rc.77",
69
69
  "@kubohiroya/turbowarp-named-data": "0.8.0-rc.0",
@@ -193,8 +193,9 @@ export async function startYamlEditorHost({siteDirectory, dataDirectory, launchE
193
193
  await mkdir(metadataDirectory, {mode: 0o700});
194
194
  await writeFile(path.join(metadataDirectory, 'session.json'), JSON.stringify({id, sourceName: input.sourceName || filename, format, createdAt: new Date().toISOString(), vscodeProfile: profile.directory}), {mode: 0o600, flag: 'wx'});
195
195
  const schemaWorkspace = await writeSchemaWorkspace(directory, schema, {format, filename});
196
- const session = {filePath, source: input.source, revision: 1};
197
- try { await launchEditor(filePath, {...profile, format, ...(schemaWorkspace || {})}); }
196
+ const launchOptions = {...profile, format, ...(schemaWorkspace || {})};
197
+ const session = {filePath, source: input.source, revision: 1, launchOptions};
198
+ try { await launchEditor(filePath, launchOptions); }
198
199
  catch {
199
200
  throw failure(503, 'EDITOR_LAUNCH_FAILED', 'VSCode could not be started. Your working YAML file was retained.');
200
201
  }
@@ -209,12 +210,22 @@ export async function startYamlEditorHost({siteDirectory, dataDirectory, launchE
209
210
  if (!idPattern.test(id)) throw failure(400, 'INVALID_SESSION', 'The YAML session identifier is invalid.');
210
211
  const session = sessions.get(id);
211
212
  if (!session) throw failure(404, 'SESSION_NOT_FOUND', 'The YAML session is no longer active.');
213
+ if (request.method === 'POST') {
214
+ await readStableSource(session.filePath);
215
+ if (sessions.get(id) !== session) throw failure(404, 'SESSION_NOT_FOUND', 'The YAML session is no longer active.');
216
+ try { await launchEditor(session.filePath, session.launchOptions); }
217
+ catch { throw failure(503, 'EDITOR_LAUNCH_FAILED', 'VSCode could not be started. Your working file was retained.'); }
218
+ if (closing) throw failure(503, 'HOST_CLOSED', 'The local YAML host is closing. Your working file was retained.');
219
+ if (sessions.get(id) !== session) throw failure(404, 'SESSION_NOT_FOUND', 'The YAML session is no longer active.');
220
+ json(response, 200, {id, revision: session.revision, opened: true});
221
+ return;
222
+ }
212
223
  if (request.method === 'DELETE') {
213
224
  sessions.delete(id);
214
225
  json(response, 200, {id, closed: true, retained: true});
215
226
  return;
216
227
  }
217
- if (request.method !== 'GET') throw failure(405, 'METHOD_NOT_ALLOWED', 'Use GET or DELETE for a YAML session.');
228
+ if (request.method !== 'GET') throw failure(405, 'METHOD_NOT_ALLOWED', 'Use GET, POST or DELETE for a YAML session.');
218
229
  const source = await readStableSource(session.filePath);
219
230
  if (sessions.get(id) !== session) throw failure(404, 'SESSION_NOT_FOUND', 'The YAML session is no longer active.');
220
231
  if (source !== session.source) { session.source = source; session.revision++; }
package/site/source.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "guiRepository": "kubohiroya/scratch-gui",
3
- "guiRevision": "ef7c2304b284cd8311218a19985a288fc7538d2c",
3
+ "guiRevision": "3088e13ef132d26eebe9b3e9024b19130dabce51",
4
4
  "coreRepository": "kubohiroya/turbowarp-extension-data-editor",
5
- "coreRevision": "91533dbbffa9eb9d3b50be8084b85dae5184f9dc",
5
+ "coreRevision": "d96532a91bc6046d4a3fda878425b30d6d10483e",
6
6
  "securityPackage": "@kubohiroya/turbowarp-extension-security-dialog",
7
7
  "securityVersion": "0.4.0",
8
+ "securityRevision": "f9a5996d27789a7f4cd4ea26838ce74bda451daa",
8
9
  "loaderRepository": "kubohiroya/turbowarp-extension-loader",
9
10
  "loaderRevision": "9dc2689a8e2b5416687f27d1ec089b3531fd03c7",
10
11
  "vmRepository": "kubohiroya/scratch-vm",
@@ -12,5 +13,5 @@
12
13
  "vmBaseRevision": "55fd9b7c9509827c9cec31482aa63f2d57ec564d",
13
14
  "packagerRepository": "TurboWarp/packager",
14
15
  "packagerRevision": "c115bdf525c5f49f0fb689a21b335ccb70fc22d2",
15
- "coreVersion": "0.6.0"
16
+ "coreVersion": "0.7.0"
16
17
  }