@kubohiroya/turbowarp-bubble 0.3.0 → 0.3.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.md +1 -1
- package/dist/composition.js +70 -66
- package/dist/turbowarp-adapter.js +126 -122
- package/dist/turbowarp-bubble.js +12 -8
- package/docs/block-manual.ja.md +1 -1
- package/docs/block-manual.md +1 -1
- package/docs/index.html +2 -2
- package/docs/ja/index.html +2 -2
- package/package.json +1 -1
package/dist/turbowarp-bubble.js
CHANGED
|
@@ -8330,7 +8330,7 @@
|
|
|
8330
8330
|
]);
|
|
8331
8331
|
if (Object.keys(input).filter((key) => !allowed.has(key)).length > 0 || input.unit === void 0) throw new TypeError("Bubble reveal has unknown or missing properties.");
|
|
8332
8332
|
const unit = requireUnit(input.unit);
|
|
8333
|
-
const delimiters = input.delimiters ?? "
|
|
8333
|
+
const delimiters = input.delimiters ?? " \r\n";
|
|
8334
8334
|
if (typeof delimiters !== "string" || delimiters.length === 0) throw new TypeError("Bubble WORD delimiters must be a non-empty string.");
|
|
8335
8335
|
const showDelimiters = input.showDelimiters ?? false;
|
|
8336
8336
|
if (typeof showDelimiters !== "boolean") throw new TypeError("Bubble reveal showDelimiters must be boolean.");
|
|
@@ -8339,18 +8339,18 @@
|
|
|
8339
8339
|
const intervalSeconds = input.intervalSeconds ?? 0;
|
|
8340
8340
|
if (typeof intervalSeconds !== "number" || !Number.isFinite(intervalSeconds) || intervalSeconds < 0) throw new TypeError("Bubble reveal intervalSeconds must be zero or greater.");
|
|
8341
8341
|
const sound = input.sound;
|
|
8342
|
-
if (sound !== void 0 && (typeof sound !== "string" || sound.
|
|
8342
|
+
if (sound !== void 0 && (typeof sound !== "string" || sound.length === 0)) throw new TypeError("Bubble reveal sound must be a non-empty asset name.");
|
|
8343
8343
|
return Object.freeze({
|
|
8344
8344
|
unit,
|
|
8345
8345
|
delimiters,
|
|
8346
8346
|
showDelimiters,
|
|
8347
8347
|
layout,
|
|
8348
8348
|
intervalSeconds,
|
|
8349
|
-
...sound === void 0 ? {} : { sound
|
|
8349
|
+
...sound === void 0 ? {} : { sound }
|
|
8350
8350
|
});
|
|
8351
8351
|
}
|
|
8352
8352
|
function splitWords(text, delimiters, showDelimiters) {
|
|
8353
|
-
const delimiterSet = new Set(
|
|
8353
|
+
const delimiterSet = new Set(Array.from(delimiters));
|
|
8354
8354
|
const result = [];
|
|
8355
8355
|
let current = "";
|
|
8356
8356
|
for (const character of graphemes(text)) {
|
|
@@ -8444,11 +8444,15 @@
|
|
|
8444
8444
|
if (typeof value !== "string" || value.trim().length === 0) throw new BubbleCompositionError("BUBBLE-COMPOSITION-001", `${label} must be a non-empty string.`);
|
|
8445
8445
|
return value.trim();
|
|
8446
8446
|
}
|
|
8447
|
+
function requireAssetName(value, label) {
|
|
8448
|
+
if (typeof value !== "string" || value.length === 0) throw new BubbleCompositionError("BUBBLE-COMPOSITION-001", `${label} must be a non-empty string.`);
|
|
8449
|
+
return value;
|
|
8450
|
+
}
|
|
8447
8451
|
function normalizeAnimation(value, label, minimumFrames) {
|
|
8448
8452
|
if (!isRecord$1(value)) throw new BubbleCompositionError("BUBBLE-COMPOSITION-001", `${label} must be an object.`);
|
|
8449
8453
|
requireExactKeys(value, ["frames", "frameIntervalSeconds"], [], label);
|
|
8450
8454
|
if (!Array.isArray(value.frames) || value.frames.length < minimumFrames) throw new BubbleCompositionError("BUBBLE-COMPOSITION-001", `${label}.frames must contain at least ${minimumFrames} image asset name${minimumFrames === 1 ? "" : "s"}.`);
|
|
8451
|
-
const frames = Object.freeze(value.frames.map((frame, index) =>
|
|
8455
|
+
const frames = Object.freeze(value.frames.map((frame, index) => requireAssetName(frame, `${label}.frames[${index}]`)));
|
|
8452
8456
|
const interval = value.frameIntervalSeconds;
|
|
8453
8457
|
if (typeof interval !== "number" || !Number.isFinite(interval) || interval <= 0) throw new BubbleCompositionError("BUBBLE-COMPOSITION-001", `${label}.frameIntervalSeconds must be a positive finite number.`);
|
|
8454
8458
|
return Object.freeze({
|
|
@@ -8462,7 +8466,7 @@
|
|
|
8462
8466
|
const blink = value.blink === void 0 ? void 0 : normalizeAnimation(value.blink, "Bubble portrait blink", 1);
|
|
8463
8467
|
const lipSync = value.lipSync === void 0 ? void 0 : normalizeAnimation(value.lipSync, "Bubble portrait lip-sync", 1);
|
|
8464
8468
|
return Object.freeze({
|
|
8465
|
-
base:
|
|
8469
|
+
base: requireAssetName(value.base, "Bubble portrait base"),
|
|
8466
8470
|
...blink === void 0 ? {} : { blink },
|
|
8467
8471
|
...lipSync === void 0 ? {} : { lipSync }
|
|
8468
8472
|
});
|
|
@@ -8521,7 +8525,7 @@
|
|
|
8521
8525
|
"finish"
|
|
8522
8526
|
]) {
|
|
8523
8527
|
const asset = value[key];
|
|
8524
|
-
if (asset !== void 0) result[key] =
|
|
8528
|
+
if (asset !== void 0) result[key] = requireAssetName(asset, `Bubble audio ${key}`);
|
|
8525
8529
|
}
|
|
8526
8530
|
return Object.freeze(result);
|
|
8527
8531
|
}
|
|
@@ -9925,7 +9929,7 @@
|
|
|
9925
9929
|
"easeInOut"
|
|
9926
9930
|
]);
|
|
9927
9931
|
var EXTENSION_DOCS_URI = "https://kubohiroya.github.io/turbowarp-bubble/";
|
|
9928
|
-
var EXTENSION_VERSION = "0.3.
|
|
9932
|
+
var EXTENSION_VERSION = "0.3.1";
|
|
9929
9933
|
function extensionError(message) {
|
|
9930
9934
|
const error = /* @__PURE__ */ new Error(`[Bubble] ${message}`);
|
|
9931
9935
|
Object.defineProperty(error, "code", { value: "BUBBLE-EXTENSION-001" });
|
package/docs/block-manual.ja.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
| 3 | Runtime Expression 0.3.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.3.0/dist/runtime-expression.js` |
|
|
16
16
|
| 4 | Asset Manager 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.7.0/dist/asset-manager.js` |
|
|
17
17
|
| 5 | SVG Text 0.4.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.4.0/dist/svg-text.js` |
|
|
18
|
-
| 6 | Bubble 0.3.
|
|
18
|
+
| 6 | Bubble 0.3.1 | npm公開後は`https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js` |
|
|
19
19
|
|
|
20
20
|
開発中のBubbleを試す場合は、このリポジトリの`dist/turbowarp-bubble.js`をローカルカスタム拡張機能として読み込みます。表示時にSVG Textが、画像・メディア機能の使用時にAsset Managerが、待機開始時にAsync InputかRuntime Expressionが見つからなければ、Bubbleは明示的なエラーを返します。
|
|
21
21
|
|
package/docs/block-manual.md
CHANGED
|
@@ -15,7 +15,7 @@ The complete input-wait example uses six extensions. Add Temporary Variables fro
|
|
|
15
15
|
| 3 | Runtime Expression 0.3.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.3.0/dist/runtime-expression.js` |
|
|
16
16
|
| 4 | Asset Manager 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.7.0/dist/asset-manager.js` |
|
|
17
17
|
| 5 | SVG Text 0.4.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.4.0/dist/svg-text.js` |
|
|
18
|
-
| 6 | Bubble 0.3.
|
|
18
|
+
| 6 | Bubble 0.3.1 | After npm publication: `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js` |
|
|
19
19
|
|
|
20
20
|
To try a development build, load this repository's `dist/turbowarp-bubble.js` as a local custom extension. Bubble reports an explicit error if SVG Text is missing when it displays a Bubble, if an image/media feature is used without Asset Manager, or if Async Input or Runtime Expression is missing when it starts a Bubble wait.
|
|
21
21
|
|
package/docs/index.html
CHANGED
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
109
|
<td align="right">6</td>
|
|
110
|
-
<td>Bubble 0.3.
|
|
111
|
-
<td>After npm publication: <code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.
|
|
110
|
+
<td>Bubble 0.3.1</td>
|
|
111
|
+
<td>After npm publication: <code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
114
114
|
<p>To try a development build, load this repository's <code>dist/turbowarp-bubble.js</code> as a local custom extension. Bubble reports an explicit error if SVG Text is missing when it displays a Bubble, if an image/media feature is used without Asset Manager, or if Async Input or Runtime Expression is missing when it starts a Bubble wait.</p>
|
package/docs/ja/index.html
CHANGED
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
109
|
<td align="right">6</td>
|
|
110
|
-
<td>Bubble 0.3.
|
|
111
|
-
<td>npm公開後は<code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.
|
|
110
|
+
<td>Bubble 0.3.1</td>
|
|
111
|
+
<td>npm公開後は<code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
114
114
|
<p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。表示時にSVG Textが、画像・メディア機能の使用時にAsset Managerが、待機開始時にAsync InputかRuntime Expressionが見つからなければ、Bubbleは明示的なエラーを返します。</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-bubble",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Composable say and think bubbles with portrait layers and animated continue indicators for TurboWarp.",
|
|
5
5
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
6
6
|
"type": "module",
|