@kubohiroya/turbowarp-camera-source 0.19.3 → 0.19.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 CHANGED
@@ -21,27 +21,33 @@ TurboWarp-Camera-Sourceは、MediaDevicesのカメラストリームを名前付
21
21
  - ブラウザのカメラ許可
22
22
  - Camera Sourceはカメラフレームをアップロードせず、画像を保存しません。
23
23
 
24
+ ## セキュリティダイアログの説明言語
25
+
26
+ この版のビルドでは、既定の英語説明に加えて`Description[ja]`コメントへ日本語の説明を出力します。このメタデータに対応した共通セキュリティダイアログは、Editorが日本語なら日本語の説明を表示し、対応する翻訳がなければ元の説明を表示します。
27
+
28
+ 説明の翻訳は必要な実行モードを変えません。この拡張は引き続き`Unsandboxed: required`です。
29
+
24
30
  ## インストール
25
31
 
26
32
  次のURLをunsandboxed custom extensionとして読み込みます。
27
33
 
28
34
  ```text
29
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.3/dist/camera-source.js
35
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.4/dist/camera-source.js
30
36
  ```
31
37
 
32
38
  npm hostでは次を使います。
33
39
 
34
40
  ```bash
35
- pnpm add @kubohiroya/turbowarp-camera-source@0.19.3
41
+ pnpm add @kubohiroya/turbowarp-camera-source@0.19.4
36
42
  ```
37
43
 
38
- ## Quick start
44
+ ## 最初の使い方
39
45
 
40
46
  カメラストリームには役割名を使います。同じ`cameraId`を使うconsumerは1つのカメラを共有し、異なる名前は別デバイスへ割り当てられます。
41
47
 
42
48
  ```text
43
49
  start shared camera [pose] with device ID []
44
- show shared camera [pose] preview mirrored [true]
50
+ show shared camera [pose] preview flipped [horizontal]
45
51
  shared camera [pose] frame width
46
52
  shared camera [pose] frame rate
47
53
  hide shared camera [pose] preview
@@ -98,7 +104,7 @@ stop shared camera [pose]
98
104
 
99
105
  <!-- END GENERATED BLOCKS -->
100
106
 
101
- ## Runtime API
107
+ ## 実行時API
102
108
 
103
109
  他のunsandboxed拡張は`Scratch.vm.runtime.ext_kubohiroyacamerasource`を参照できます。
104
110
 
@@ -329,6 +335,53 @@ pnpm run check
329
335
 
330
336
  GitHub Pages用の静的サイトは`docs/`にあり、英語版は`docs/index.html`、日本語版は`docs/ja/index.html`です。
331
337
 
338
+ ## ビルドの流れ
339
+
340
+ ```text
341
+ TypeScript source
342
+ -> Vite
343
+ -> vite-plugin-turbowarp-extension
344
+ -> dist/camera-source.js
345
+
346
+ Extension config + block definitions
347
+ -> extension manifest plugin
348
+ -> dist/extension-manifest.json
349
+ ```
350
+
351
+ JavaScriptは、Extension Gallery向けのメタデータと標準の`(function (Scratch) { ... })(Scratch);`ラッパーを持つ、単一の非圧縮ファイルになります。
352
+
353
+ ## プロジェクト構成
354
+
355
+ - `src/config.ts`:機能拡張のメタデータ。
356
+ - `src/block-definitions.json`:拡張本体とREADME生成で共有するブロックメタデータの正本。
357
+ - `src/extension.ts`:機能拡張の実装。
358
+ - `src/video-preview.ts`:GPUを使う`HTMLVideoElement`のプレビュー描画と資源管理。
359
+ - `src/index.ts`:拡張を登録するエントリーポイント。
360
+ - `src/globals.d.ts`:このプロジェクトで使うScratch APIの型宣言。
361
+ - manifestの生成器とJSON Schemaは[`@kubohiroya/turbowarp-extension-manifest`](https://github.com/kubohiroya/turbowarp-extension-manifest)が提供します。
362
+ - `scripts/generate-readme.ts`:日英READMEのブロック説明部分を更新します。
363
+ - `tests/`:単体テスト。
364
+ - `vite.config.ts`:TurboWarp向けのViteビルド設定。
365
+ - `dist/`:リポジトリに記録するTurboWarp用JavaScriptと拡張APIのmanifest。
366
+
367
+ ## 拡張APIのmanifest
368
+
369
+ ビルドは`formatVersion: 1`の`dist/extension-manifest.json`を生成します。拡張ID、ブロックのopcodeと種類、引数のIDと型、メニュー参照を決定的な順序で記録します。`sb3-toolchain`などのツールは、同梱する拡張の更新やIDの移行に先立ってこの契約を比較できます。詳細は[設計文書(英語)](docs/architecture.md)と[v1のJSON Schema](https://github.com/kubohiroya/turbowarp-extension-manifest/blob/main/schemas/extension-manifest.schema.json)を参照してください。
370
+
371
+ 実装やブロックメタデータを変更した場合は、記録対象の配布物を再生成して検証します。
372
+
373
+ ```bash
374
+ pnpm run check:dist
375
+ ```
376
+
377
+ ## 生成ドキュメント
378
+
379
+ ```bash
380
+ pnpm run docs
381
+ ```
382
+
383
+ `pnpm run check`には`docs:check`も含まれます。`src/block-definitions.json`と日英READMEのブロック説明が一致しない場合は失敗します。
384
+
332
385
  ## ライセンス
333
386
 
334
387
  SPDX-License-Identifier: MPL-2.0
package/README.md CHANGED
@@ -25,18 +25,24 @@ or select separate cameras for separate roles.
25
25
  - User camera permission through the browser permission prompt.
26
26
  - Camera frames stay in the browser. Camera Source does not upload frames or store images.
27
27
 
28
+ ## Security dialog description language
29
+
30
+ Builds include a Japanese `Description[ja]` header alongside the default English
31
+ description. A supporting shared security dialog follows the Editor locale and falls back to
32
+ the original description when no translation is available. Translation does not change the `Unsandboxed: required` requirement.
33
+
28
34
  ## Installation
29
35
 
30
36
  Load this URL as an unsandboxed custom extension:
31
37
 
32
38
  ```text
33
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.3/dist/camera-source.js
39
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.4/dist/camera-source.js
34
40
  ```
35
41
 
36
42
  For npm hosts:
37
43
 
38
44
  ```bash
39
- pnpm add @kubohiroya/turbowarp-camera-source@0.19.3
45
+ pnpm add @kubohiroya/turbowarp-camera-source@0.19.4
40
46
  ```
41
47
 
42
48
  ## Quick Start
@@ -4,6 +4,7 @@
4
4
  // By: Hiroya Kubo
5
5
  // License: MPL-2.0
6
6
  // Unsandboxed: required
7
+ // Description[ja]: 1つのカメラ映像を複数のTurboWarp機能拡張で共有します。
7
8
 
8
9
  (function (Scratch) {
9
10
  'use strict';
@@ -7,3 +7,6 @@ export declare const extensionConfig: {
7
7
  readonly license: "MPL-2.0";
8
8
  readonly unsandboxed: true;
9
9
  };
10
+ export declare const extensionDescriptions: {
11
+ readonly ja: "1つのカメラ映像を複数のTurboWarp機能拡張で共有します。";
12
+ };
@@ -7,3 +7,4 @@ export const extensionConfig = {
7
7
  license: 'MPL-2.0',
8
8
  unsandboxed: true
9
9
  };
10
+ export const extensionDescriptions = { ja: '1つのカメラ映像を複数のTurboWarp機能拡張で共有します。' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-camera-source",
3
- "version": "0.19.3",
3
+ "version": "0.19.4",
4
4
  "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
5
5
  "description": "A TurboWarp capability extension for sharing one MediaDevices camera stream across extensions.",
6
6
  "type": "module",
@@ -74,7 +74,7 @@
74
74
  "@kubohiroya/turbowarp-app-shell": "0.3.1",
75
75
  "@eslint/js": "^9.39.5",
76
76
  "@kubohiroya/turbowarp-extension-manifest": "0.3.2",
77
- "@kubohiroya/vite-plugin-turbowarp-extension": "0.6.1",
77
+ "@kubohiroya/vite-plugin-turbowarp-extension": "0.7.0",
78
78
  "@types/node": "^24.13.3",
79
79
  "ajv": "^8.20.0",
80
80
  "eslint": "^9.39.5",