@kubohiroya/turbowarp-bubble 0.18.0 → 0.18.1

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
@@ -6,7 +6,7 @@
6
6
 
7
7
  `@kubohiroya/turbowarp-bubble`は、TurboWarp上の`say`/`think`表示を、文字、キャラクター表情、入力待ちアイコンに分けて管理するunsandboxed機能拡張です。同じ機能をアプリから直接利用するためのcomposition APIも提供します。
8
8
 
9
- 現在のリリースはBubble 0.18.0です。既定の描画経路はSVG Text 0.14.0を使うskin非依存のSVG overlayです。TurboWarpですべての機能を使う場合、現在の推奨組み合わせはAsset Cache 0.8.0、Async Input 0.12.0、Runtime Expression 0.10.0です。Asset Cacheへの移行については[0.13.0のリリースノート](docs/release-notes-0.13.0.md)、再利用可能な名前付きclose policyについては[0.10.0のリリースノート](docs/release-notes-0.10.0.md)、組み込み`say`/`think` styleについては[0.9.0のリリースノート](docs/release-notes-0.9.0.md)を参照してください。
9
+ 現在のリリースはBubble 0.18.1です。既定の描画経路はSVG Text 0.14.0を使うskin非依存のSVG overlayです。TurboWarpですべての機能を使う場合、現在の推奨組み合わせはAsset Cache 0.8.0、Async Input 0.12.0、Runtime Expression 0.10.0です。Asset Cacheへの移行については[0.13.0のリリースノート](docs/release-notes-0.13.0.md)、再利用可能な名前付きclose policyについては[0.10.0のリリースノート](docs/release-notes-0.10.0.md)、組み込み`say`/`think` styleについては[0.9.0のリリースノート](docs/release-notes-0.9.0.md)を参照してください。
10
10
 
11
11
  ## 最小デモ
12
12
 
@@ -334,7 +334,7 @@ TurboWarp Bubbleの`dist/turbowarp-bubble.js`は、TurboWarpのrendererとtarget
334
334
  2. 「カスタム拡張機能」を選び、サンドボックスなし(Run without sandbox)で実行できる状態にします。
335
335
  3. portrait、blink、lip-sync、continue frames、音声を使う場合はAsset Cache 0.8.0を読み込みます。
336
336
  4. `finish [UNIT] ...`にはRuntime Expression 0.10.0、conditionを使う待機またはclose policyにはAsync Input 0.12.0とRuntime Expression 0.10.0を読み込みます。timeoutだけのclose policyにはどちらも不要です。
337
- 5. 最後にBubble 0.18.0を読み込みます。SVG Text 0.14.0のlayout providerはBubble bundleに含まれます。
337
+ 5. 最後にBubble 0.18.1を読み込みます。SVG Text 0.14.0のlayout providerはBubble bundleに含まれます。
338
338
 
339
339
  文字だけの最小構成はBubbleです。Temporary Variables、Asset Cache、Async Input、Runtime Expressionは、対応する機能を使わなければ追加しなくても構いません。Bubbleを読み込むと、基本の`say [MESSAGE]`/`think [MESSAGE]`ブロックはstyle定義なしですぐ使えます。それぞれ組み込みBubble style `say`/`think`を選び、各styleが本体形状とtail/trail形状を不可分な1つの外観として持ちます。どちらも予約text profile `default`を使います。named custom styleが必要な場合だけ`define bubble style`と`show [MESSAGE] with bubble style [STYLE]`を使います。それ以外のnamed text styleや、外形・配置・media・reveal・motionの明示設定はcustom profileになります。
340
340
 
@@ -349,7 +349,7 @@ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async
349
349
  https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js
350
350
 
351
351
  # Bubble(必ず最後)
352
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js
352
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js
353
353
  ```
354
354
 
355
355
  TurboWarpのカスタム拡張機能はURLからJavaScriptを読み込むため、初回読み込み時にネットワーク接続が必要です。開発用URLをunsandboxedとして読み込むには、server originを正確に`http://localhost:8000/`とする必要があります。`127.0.0.1`、`0.0.0.0`、ほかのportにはこの例外が適用されません。リポジトリrootで`python3 -m http.server 8000`を実行し、`http://localhost:8000/dist/turbowarp-bubble.js`を読み込んでください。別の方法として、カスタム拡張機能のfileまたはtext入力を選び、**サンドボックスなしで実行する**を有効にできます。`file://`で直接開いたファイルや、サンドボックス付きの拡張機能としては動作しません。host制約の詳細は[TurboWarpのunsandboxed拡張機能ドキュメント](https://docs.turbowarp.org/development/extensions/unsandboxed)を参照してください。
package/README.md CHANGED
@@ -6,7 +6,7 @@ English | [日本語](README.ja.md)
6
6
 
7
7
  `@kubohiroya/turbowarp-bubble` is an unsandboxed extension that manages TurboWarp `say` and `think` displays as separate text, character-expression, and input-waiting indicator layers. It also provides a composition API for using the same features directly from applications.
8
8
 
9
- The current release is Bubble 0.18.0. Its default rendering path is the skin-free SVG overlay backed by SVG Text 0.14.0. For the complete TurboWarp feature set, the currently recommended companion releases are Asset Cache 0.8.0, Async Input 0.12.0, and Runtime Expression 0.10.0. See the [0.13.0 release notes](docs/release-notes-0.13.0.md) for the Asset Cache migration, the [0.10.0 release notes](docs/release-notes-0.10.0.md) for reusable named close policies, and the [0.9.0 release notes](docs/release-notes-0.9.0.md) for the built-in `say`/`think` styles.
9
+ The current release is Bubble 0.18.1. Its default rendering path is the skin-free SVG overlay backed by SVG Text 0.14.0. For the complete TurboWarp feature set, the currently recommended companion releases are Asset Cache 0.8.0, Async Input 0.12.0, and Runtime Expression 0.10.0. See the [0.13.0 release notes](docs/release-notes-0.13.0.md) for the Asset Cache migration, the [0.10.0 release notes](docs/release-notes-0.10.0.md) for reusable named close policies, and the [0.9.0 release notes](docs/release-notes-0.9.0.md) for the built-in `say`/`think` styles.
10
10
 
11
11
  ## Minimal demo
12
12
 
@@ -334,7 +334,7 @@ TurboWarp Bubble's `dist/turbowarp-bubble.js` is an **unsandboxed custom extensi
334
334
  2. Select “Custom Extension” and enable Run without sandbox.
335
335
  3. Load Asset Cache 0.8.0 if you use portraits, blinking, lip-sync, continue frames, or audio.
336
336
  4. Load Runtime Expression 0.10.0 for `finish [UNIT] ...`; load both Async Input 0.12.0 and Runtime Expression 0.10.0 for condition-based waits and close policies. A timeout-only close policy needs neither extension.
337
- 5. Load Bubble 0.18.0 last. The SVG Text 0.14.0 layout provider is included in the Bubble bundle.
337
+ 5. Load Bubble 0.18.1 last. The SVG Text 0.14.0 layout provider is included in the Bubble bundle.
338
338
 
339
339
  Bubble alone is the minimum configuration for text-only use. Temporary Variables, Asset Cache, Async Input, and Runtime Expression can be omitted when you do not use the features they support. After loading Bubble, its basic `say [MESSAGE]` and `think [MESSAGE]` blocks work immediately without a style definition. They select the built-in Bubble styles `say` and `think`, respectively. Each style binds its body shape and tail/trail shape as one visual choice, and both use the reserved text profile `default`. Use `define bubble style` and `show [MESSAGE] with bubble style [STYLE]` only when you need a named custom style. Other named text styles and every explicit body, placement, media, reveal, or motion setting select the custom profile.
340
340
 
@@ -349,7 +349,7 @@ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async
349
349
  https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js
350
350
 
351
351
  # Bubble (always load last)
352
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js
352
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js
353
353
  ```
354
354
 
355
355
  TurboWarp custom extensions load JavaScript from URLs, so a network connection is required the first time they are loaded. For an unsandboxed development URL, TurboWarp requires the server origin to be exactly `http://localhost:8000/`; `127.0.0.1`, `0.0.0.0`, and other ports do not receive this exception. From the repository root, run `python3 -m http.server 8000`, then load `http://localhost:8000/dist/turbowarp-bubble.js`. Alternatively, choose the custom-extension file or text input and enable **Run extension without sandbox**. The extension does not work when opened directly with `file://` or when run as a sandboxed extension. See [TurboWarp's unsandboxed extension documentation](https://docs.turbowarp.org/development/extensions/unsandboxed) for the host restrictions.
@@ -1260,21 +1260,40 @@ function registerFixedInputEditors$1(scratch, runtime) {
1260
1260
  const api = scratch.gui?.blockEditors;
1261
1261
  if (api?.apiVersion !== 1 || typeof api.registerFixedInputEditor !== "function") return void 0;
1262
1262
  const events = runtime;
1263
+ const definitions = fixedInputEditorOptions$1();
1263
1264
  const removers = [];
1264
- let active = true;
1265
- const dispose = () => {
1266
- if (!active) return;
1267
- active = false;
1268
- events.off?.("RUNTIME_DISPOSED", dispose);
1265
+ let state = "registered";
1266
+ const release = () => {
1269
1267
  for (const remove of removers.splice(0).reverse()) remove();
1270
1268
  };
1271
- try {
1272
- for (const options of fixedInputEditorOptions$1()) removers.push(api.registerFixedInputEditor.call(api, options));
1273
- events.on?.("RUNTIME_DISPOSED", dispose);
1274
- } catch (error) {
1275
- dispose();
1276
- throw error;
1277
- }
1269
+ const register = () => {
1270
+ try {
1271
+ for (const options of definitions) removers.push(api.registerFixedInputEditor.call(api, options));
1272
+ } catch (error) {
1273
+ release();
1274
+ throw error;
1275
+ }
1276
+ };
1277
+ const releaseForRuntimeDispose = () => {
1278
+ if (state !== "registered") return;
1279
+ state = "released";
1280
+ release();
1281
+ };
1282
+ const restoreAfterProjectLoad = () => {
1283
+ if (state !== "released") return;
1284
+ register();
1285
+ state = "registered";
1286
+ };
1287
+ const dispose = () => {
1288
+ if (state === "disposed") return;
1289
+ state = "disposed";
1290
+ events.off?.("RUNTIME_DISPOSED", releaseForRuntimeDispose);
1291
+ events.off?.("PROJECT_LOADED", restoreAfterProjectLoad);
1292
+ release();
1293
+ };
1294
+ register();
1295
+ events.on?.("RUNTIME_DISPOSED", releaseForRuntimeDispose);
1296
+ events.on?.("PROJECT_LOADED", restoreAfterProjectLoad);
1278
1297
  return dispose;
1279
1298
  }
1280
1299
  //#endregion
@@ -13605,7 +13624,7 @@ var builtInBubbleStyles = Object.freeze([Object.freeze({
13605
13624
  textStyle: "default"
13606
13625
  })]);
13607
13626
  var EXTENSION_DOCS_URI = "https://kubohiroya.github.io/turbowarp-bubble/";
13608
- var EXTENSION_VERSION = "0.18.0";
13627
+ var EXTENSION_VERSION = "0.18.1";
13609
13628
  var BLOCK_ICON_URI = extensionConfig$1.blockIconURI;
13610
13629
  function extensionError(message) {
13611
13630
  const error = /* @__PURE__ */ new Error(`[Bubble] ${message}`);
@@ -13641,7 +13660,7 @@ var BubbleExtension = class {
13641
13660
  runtime.on?.("PROJECT_STOP_ALL", releaseAll);
13642
13661
  runtime.on?.("STOP_FOR_TARGET", releaseTarget);
13643
13662
  runtime.on?.("RUNTIME_DISPOSED", () => {
13644
- this.dispose().catch(() => void 0);
13663
+ this.resetForProject().catch(() => void 0);
13645
13664
  });
13646
13665
  }
13647
13666
  getInfo() {
@@ -14045,9 +14064,23 @@ var BubbleExtension = class {
14045
14064
  this.handles.clear();
14046
14065
  }
14047
14066
  async dispose() {
14067
+ this.fixedEditorsDispose?.();
14068
+ await this.disposeBubbles();
14069
+ }
14070
+ async resetForProject() {
14071
+ if (this.disposed) return;
14072
+ this.cancelAllWaits("Bubble project was unloaded.");
14073
+ const composition = this.composition;
14074
+ this.composition = null;
14075
+ this.handles.clear();
14076
+ this.styles.clear();
14077
+ for (const style of builtInBubbleStyles) this.styles.set(style.name, style);
14078
+ this.closePolicies.clear();
14079
+ if (composition) await composition.dispose();
14080
+ }
14081
+ async disposeBubbles() {
14048
14082
  if (this.disposed) return;
14049
14083
  this.disposed = true;
14050
- this.fixedEditorsDispose?.();
14051
14084
  this.cancelAllWaits("Bubble extension was disposed.");
14052
14085
  if (this.composition) await this.composition.dispose();
14053
14086
  this.handles.clear();
@@ -16,7 +16,7 @@
16
16
  | 2 | Async Input 0.12.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async-input.js` |
17
17
  | 3 | Runtime Expression 0.10.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js` |
18
18
  | 4 | Asset Cache 0.8.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.8.0/dist/asset-cache.js` |
19
- | 5 | Bubble 0.18.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js` |
19
+ | 5 | Bubble 0.18.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js` |
20
20
 
21
21
  開発中のBubbleを試す場合は、このリポジトリの`dist/turbowarp-bubble.js`をローカルカスタム拡張機能として読み込みます。既定SVG overlayに必要なrenderer APIがない場合、画像・メディア機能の使用時にAsset Cacheがない場合、condition待機の開始時にAsync InputかRuntime Expressionがない場合は、Bubbleが明示的なエラーを返します。低レベルComposition APIでは別のtext capabilityを注入できます。
22
22
 
@@ -16,7 +16,7 @@ The complete input-wait example uses five extensions. Add Temporary Variables fr
16
16
  | 2 | Async Input 0.12.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async-input.js` |
17
17
  | 3 | Runtime Expression 0.10.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js` |
18
18
  | 4 | Asset Cache 0.8.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.8.0/dist/asset-cache.js` |
19
- | 5 | Bubble 0.18.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js` |
19
+ | 5 | Bubble 0.18.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js` |
20
20
 
21
21
  To try a development build, load this repository's `dist/turbowarp-bubble.js` as a local custom extension. Bubble reports an explicit error if the renderer lacks the default SVG overlay APIs, if an image/media feature is used without Asset Cache, or if Async Input or Runtime Expression is missing when it starts a condition-based Bubble wait. The lower-level Composition API can inject another text capability.
22
22
 
package/docs/index.html CHANGED
@@ -96,8 +96,8 @@
96
96
  </tr>
97
97
  <tr>
98
98
  <td align="right">5</td>
99
- <td>Bubble 0.18.0</td>
100
- <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js</code></td>
99
+ <td>Bubble 0.18.1</td>
100
+ <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js</code></td>
101
101
  </tr>
102
102
  </tbody></table>
103
103
  <p>To try a development build, load this repository&#39;s <code>dist/turbowarp-bubble.js</code> as a local custom extension. Bubble reports an explicit error if the renderer lacks the default SVG overlay APIs, if an image/media feature is used without Asset Cache, or if Async Input or Runtime Expression is missing when it starts a condition-based Bubble wait. The lower-level Composition API can inject another text capability.</p>
@@ -96,8 +96,8 @@
96
96
  </tr>
97
97
  <tr>
98
98
  <td align="right">5</td>
99
- <td>Bubble 0.18.0</td>
100
- <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.0/dist/turbowarp-bubble.js</code></td>
99
+ <td>Bubble 0.18.1</td>
100
+ <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.18.1/dist/turbowarp-bubble.js</code></td>
101
101
  </tr>
102
102
  </tbody></table>
103
103
  <p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。既定SVG overlayに必要なrenderer APIがない場合、画像・メディア機能の使用時にAsset Cacheがない場合、condition待機の開始時にAsync InputかRuntime Expressionがない場合は、Bubbleが明示的なエラーを返します。低レベルComposition APIでは別のtext capabilityを注入できます。</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-bubble",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Composable say and think bubbles with portrait layers and animated continue indicators for TurboWarp.",
5
5
  "author": {
6
6
  "name": "Hiroya Kubo",