@kubohiroya/turbowarp-bubble 0.16.0 → 0.17.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 +17 -17
- package/README.md +17 -17
- package/dist/composition.js +525 -521
- package/dist/turbowarp-adapter.js +1035 -961
- package/dist/turbowarp-bubble.js +189 -58
- package/dist/types/bubble-svg.d.ts +15 -0
- package/docs/assets/bubble-style-gallery.svg +2 -2
- package/docs/assets/width-linebreak-guide.svg +6 -6
- package/docs/block-manual.ja.md +10 -10
- package/docs/block-manual.md +10 -10
- package/docs/index.html +11 -11
- package/docs/ja/index.html +11 -11
- package/package.json +10 -10
package/dist/turbowarp-bubble.js
CHANGED
|
@@ -6623,6 +6623,105 @@ var emptyBodyMinimumSize = Object.freeze({
|
|
|
6623
6623
|
function bubbleBodyMinimumSize(...styles) {
|
|
6624
6624
|
return styles.some((style) => style === "THINKING" || style === "DREAMING") ? cloudBodyMinimumSize : emptyBodyMinimumSize;
|
|
6625
6625
|
}
|
|
6626
|
+
var contentFitStep = 2;
|
|
6627
|
+
var contentFitMaximumSteps = 400;
|
|
6628
|
+
var contentFitCache = /* @__PURE__ */ new Map();
|
|
6629
|
+
var contentFitCacheLimit = 128;
|
|
6630
|
+
/**
|
|
6631
|
+
* The region of a style's body that content may occupy without touching the
|
|
6632
|
+
* border. Undefined means the style draws no outline around the content.
|
|
6633
|
+
*/
|
|
6634
|
+
function contentRegion(style, width, height) {
|
|
6635
|
+
switch (style) {
|
|
6636
|
+
case "NO_BUBBLE": return;
|
|
6637
|
+
case "THINKING":
|
|
6638
|
+
case "DREAMING": return cloudValleyPoints(width, height);
|
|
6639
|
+
case "YELLING": return burstBodyPoints(width, height);
|
|
6640
|
+
case "WAVY": return wavyBodyPoints(width, height);
|
|
6641
|
+
case "ANNOUNCEMENT": return roundedRectanglePoints(width, height, 13, 30);
|
|
6642
|
+
case "NORMAL":
|
|
6643
|
+
case "OFF_PANEL":
|
|
6644
|
+
case "WHISPERING":
|
|
6645
|
+
case "NARRATION": return roundedRectanglePoints(width, height);
|
|
6646
|
+
}
|
|
6647
|
+
}
|
|
6648
|
+
function pointInPolygon(point, polygon) {
|
|
6649
|
+
let inside = false;
|
|
6650
|
+
for (let index = 0, previousIndex = polygon.length - 1; index < polygon.length; previousIndex = index, index += 1) {
|
|
6651
|
+
const current = polygon[index];
|
|
6652
|
+
const previous = polygon[previousIndex];
|
|
6653
|
+
if (!current || !previous) continue;
|
|
6654
|
+
if (current.y > point.y !== previous.y > point.y && point.x < (previous.x - current.x) * (point.y - current.y) / (previous.y - current.y) + current.x) inside = !inside;
|
|
6655
|
+
}
|
|
6656
|
+
return inside;
|
|
6657
|
+
}
|
|
6658
|
+
/**
|
|
6659
|
+
* Counts the sample points where a centered content box, inflated by the
|
|
6660
|
+
* clearance, escapes the polygon, plus polygon vertices poking into the box.
|
|
6661
|
+
* Zero means the content fits inside the outline.
|
|
6662
|
+
*/
|
|
6663
|
+
function contentOverflow(polygon, width, height, contentWidth, contentHeight) {
|
|
6664
|
+
const halfWidth = contentWidth / 2 + 6;
|
|
6665
|
+
const halfHeight = contentHeight / 2 + 6;
|
|
6666
|
+
const left = width / 2 - halfWidth;
|
|
6667
|
+
const right = width / 2 + halfWidth;
|
|
6668
|
+
const top = height / 2 - halfHeight;
|
|
6669
|
+
const bottom = height / 2 + halfHeight;
|
|
6670
|
+
const outside = (x, y) => pointInPolygon({
|
|
6671
|
+
x,
|
|
6672
|
+
y
|
|
6673
|
+
}, polygon) ? 0 : 1;
|
|
6674
|
+
let count = 0;
|
|
6675
|
+
const columns = Math.max(1, Math.ceil((right - left) / 4));
|
|
6676
|
+
const rows = Math.max(1, Math.ceil((bottom - top) / 4));
|
|
6677
|
+
for (let index = 0; index <= columns; index += 1) {
|
|
6678
|
+
const sampleX = left + (right - left) * index / columns;
|
|
6679
|
+
count += outside(sampleX, top) + outside(sampleX, bottom);
|
|
6680
|
+
}
|
|
6681
|
+
for (let index = 1; index < rows; index += 1) {
|
|
6682
|
+
const sampleY = top + (bottom - top) * index / rows;
|
|
6683
|
+
count += outside(left, sampleY) + outside(right, sampleY);
|
|
6684
|
+
}
|
|
6685
|
+
for (const vertex of polygon) if (vertex.x > left && vertex.x < right && vertex.y > top && vertex.y < bottom) count += 1;
|
|
6686
|
+
return count;
|
|
6687
|
+
}
|
|
6688
|
+
/**
|
|
6689
|
+
* Computes the Bubble SVG size whose visible outline encloses a content box of
|
|
6690
|
+
* the given size with {@link bubbleContentClearance} to spare, for every listed
|
|
6691
|
+
* style (all styles of a shape transition must fit the same content).
|
|
6692
|
+
*/
|
|
6693
|
+
function bubbleBodySizeForContent(input) {
|
|
6694
|
+
const contentWidth = Math.max(0, input.contentWidth);
|
|
6695
|
+
const contentHeight = Math.max(0, input.contentHeight);
|
|
6696
|
+
if (!Number.isFinite(contentWidth) || !Number.isFinite(contentHeight)) throw new TypeError("Bubble content size must be finite.");
|
|
6697
|
+
const styles = [...new Set(input.styles)];
|
|
6698
|
+
const key = `${styles.join(",")}:${contentWidth}:${contentHeight}`;
|
|
6699
|
+
const cached = contentFitCache.get(key);
|
|
6700
|
+
if (cached) return cached;
|
|
6701
|
+
const overflowAt = (width, height) => styles.reduce((sum, style) => {
|
|
6702
|
+
const region = contentRegion(style, width, height);
|
|
6703
|
+
return region ? sum + contentOverflow(region, width, height, contentWidth, contentHeight) : sum;
|
|
6704
|
+
}, 0);
|
|
6705
|
+
const minimum = bubbleBodyMinimumSize(...styles);
|
|
6706
|
+
let width = Math.max(contentWidth + 48, minimum.width);
|
|
6707
|
+
let height = Math.max(contentHeight + 48, minimum.height);
|
|
6708
|
+
for (let step = 0; step < contentFitMaximumSteps && overflowAt(width, height) > 0; step += 1) {
|
|
6709
|
+
const wider = overflowAt(width + contentFitStep, height);
|
|
6710
|
+
const taller = overflowAt(width, height + contentFitStep);
|
|
6711
|
+
if (wider <= taller) width += contentFitStep;
|
|
6712
|
+
if (taller <= wider) height += contentFitStep;
|
|
6713
|
+
}
|
|
6714
|
+
const result = Object.freeze({
|
|
6715
|
+
height,
|
|
6716
|
+
width
|
|
6717
|
+
});
|
|
6718
|
+
if (contentFitCache.size >= contentFitCacheLimit) {
|
|
6719
|
+
const oldest = contentFitCache.keys().next().value;
|
|
6720
|
+
if (oldest !== void 0) contentFitCache.delete(oldest);
|
|
6721
|
+
}
|
|
6722
|
+
contentFitCache.set(key, result);
|
|
6723
|
+
return result;
|
|
6724
|
+
}
|
|
6626
6725
|
function escapeXml$2(value) {
|
|
6627
6726
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
6628
6727
|
}
|
|
@@ -6637,11 +6736,11 @@ function normalizeDirection(value) {
|
|
|
6637
6736
|
if (!Number.isFinite(direction)) throw new TypeError("tailDirection must be finite.");
|
|
6638
6737
|
return (direction % 360 + 360) % 360;
|
|
6639
6738
|
}
|
|
6640
|
-
function roundedRectanglePoints(width, height, radius = 18) {
|
|
6641
|
-
const left =
|
|
6642
|
-
const top =
|
|
6643
|
-
const right = width -
|
|
6644
|
-
const bottom = height -
|
|
6739
|
+
function roundedRectanglePoints(width, height, radius = 18, inset = 24) {
|
|
6740
|
+
const left = inset;
|
|
6741
|
+
const top = inset;
|
|
6742
|
+
const right = width - inset;
|
|
6743
|
+
const bottom = height - inset;
|
|
6645
6744
|
const segmentsPerCorner = 10;
|
|
6646
6745
|
return [
|
|
6647
6746
|
{
|
|
@@ -6814,56 +6913,84 @@ function unionBodyAndTail(body, bodyCenter, tip, fill, border, extra = "") {
|
|
|
6814
6913
|
if (!outer) throw new Error("JSClipper returned an empty Bubble outline.");
|
|
6815
6914
|
return `<path d="${polygonPath(outer)}" fill="${fill}" stroke="${border}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${extra}/>`;
|
|
6816
6915
|
}
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6916
|
+
/** Relative chord lengths that keep cloud puffs from looking machine-regular. */
|
|
6917
|
+
var cloudPuffRhythm = Object.freeze([
|
|
6918
|
+
1,
|
|
6919
|
+
.78,
|
|
6920
|
+
1.14,
|
|
6921
|
+
.88,
|
|
6922
|
+
1.06,
|
|
6923
|
+
.8,
|
|
6924
|
+
1.2,
|
|
6925
|
+
.92
|
|
6926
|
+
]);
|
|
6927
|
+
/**
|
|
6928
|
+
* Returns the valleys between cloud puffs. Every puff bulges outward from the
|
|
6929
|
+
* polygon through these points, so the polygon is the cloud's inner envelope.
|
|
6930
|
+
*/
|
|
6931
|
+
function cloudValleyPoints(width, height) {
|
|
6932
|
+
const boxWidth = width - 48;
|
|
6933
|
+
const boxHeight = height - 48;
|
|
6934
|
+
const centerX = width / 2;
|
|
6935
|
+
const centerY = height / 2;
|
|
6936
|
+
const nominalChord = Math.min(40, Math.max(22, 20 + Math.min(boxWidth, boxHeight) * .12 + Math.max(boxWidth, boxHeight) * .03));
|
|
6937
|
+
const puffHeight = nominalChord * .34;
|
|
6938
|
+
const radiusX = Math.max(1, boxWidth / 2 - puffHeight);
|
|
6939
|
+
const radiusY = Math.max(1, boxHeight / 2 - puffHeight);
|
|
6940
|
+
const exponent = 3;
|
|
6941
|
+
const base = (angle) => {
|
|
6942
|
+
const cos = Math.cos(angle);
|
|
6943
|
+
const sin = Math.sin(angle);
|
|
6944
|
+
return {
|
|
6945
|
+
x: centerX + radiusX * Math.sign(cos) * Math.abs(cos) ** (2 / exponent),
|
|
6946
|
+
y: centerY + radiusY * Math.sign(sin) * Math.abs(sin) ** (2 / exponent)
|
|
6833
6947
|
};
|
|
6834
|
-
|
|
6948
|
+
};
|
|
6949
|
+
const samples = 720;
|
|
6950
|
+
const cumulative = [0];
|
|
6951
|
+
let previous = base(-Math.PI / 2);
|
|
6952
|
+
for (let index = 1; index <= samples; index += 1) {
|
|
6953
|
+
const current = base(-Math.PI / 2 + index * Math.PI * 2 / samples);
|
|
6954
|
+
cumulative.push((cumulative[index - 1] ?? 0) + Math.hypot(current.x - previous.x, current.y - previous.y));
|
|
6955
|
+
previous = current;
|
|
6956
|
+
}
|
|
6957
|
+
const perimeter = cumulative[samples] ?? 0;
|
|
6958
|
+
const rhythmTotal = cloudPuffRhythm.reduce((sum, value) => sum + value, 0);
|
|
6959
|
+
const count = Math.max(8, Math.round(perimeter / (nominalChord * rhythmTotal) * cloudPuffRhythm.length));
|
|
6960
|
+
const weights = Array.from({ length: count }, (_, index) => cloudPuffRhythm[index % cloudPuffRhythm.length] ?? 1);
|
|
6961
|
+
const weightTotal = weights.reduce((sum, value) => sum + value, 0);
|
|
6962
|
+
const pointAtLength = (length) => {
|
|
6963
|
+
let low = 0;
|
|
6964
|
+
let high = samples;
|
|
6965
|
+
while (high - low > 1) {
|
|
6966
|
+
const middle = low + high >> 1;
|
|
6967
|
+
if ((cumulative[middle] ?? 0) <= length) low = middle;
|
|
6968
|
+
else high = middle;
|
|
6969
|
+
}
|
|
6970
|
+
const from = cumulative[low] ?? 0;
|
|
6971
|
+
const to = cumulative[high] ?? from;
|
|
6972
|
+
const ratio = to > from ? (length - from) / (to - from) : 0;
|
|
6973
|
+
return base(-Math.PI / 2 + (low + ratio) * Math.PI * 2 / samples);
|
|
6974
|
+
};
|
|
6975
|
+
let travelled = 0;
|
|
6976
|
+
return weights.map((weight) => {
|
|
6977
|
+
const point = pointAtLength(travelled / weightTotal * perimeter);
|
|
6978
|
+
travelled += weight;
|
|
6979
|
+
return point;
|
|
6835
6980
|
});
|
|
6836
|
-
return `M ${format(first.x)} ${format(first.y)} ${segments.join(" ")} Z`;
|
|
6837
6981
|
}
|
|
6838
6982
|
function cloudBody(width, height, fill, border) {
|
|
6839
|
-
const
|
|
6840
|
-
const
|
|
6841
|
-
const
|
|
6842
|
-
|
|
6843
|
-
const
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
x
|
|
6847
|
-
|
|
6983
|
+
const format = (value) => value.toFixed(4);
|
|
6984
|
+
const points = cloudValleyPoints(width, height);
|
|
6985
|
+
const first = points[0];
|
|
6986
|
+
if (!first) throw new Error("Cloud Bubble path is invalid.");
|
|
6987
|
+
const arcs = points.map((_, index) => {
|
|
6988
|
+
const from = points[index] ?? first;
|
|
6989
|
+
const to = points[(index + 1) % points.length] ?? first;
|
|
6990
|
+
const radius = Math.hypot(to.x - from.x, to.y - from.y) * .56;
|
|
6991
|
+
return `A ${format(radius)} ${format(radius)} 0 0 1 ${format(to.x)} ${format(to.y)}`;
|
|
6848
6992
|
});
|
|
6849
|
-
return `<path d="${
|
|
6850
|
-
point(0, .5),
|
|
6851
|
-
point(.03, .3),
|
|
6852
|
-
point(.18, .2),
|
|
6853
|
-
point(.28, .04),
|
|
6854
|
-
point(.5, .16),
|
|
6855
|
-
point(.68, .03),
|
|
6856
|
-
point(.84, .18),
|
|
6857
|
-
point(.98, .3),
|
|
6858
|
-
point(1, .52),
|
|
6859
|
-
point(.95, .7),
|
|
6860
|
-
point(.82, .82),
|
|
6861
|
-
point(.68, .97),
|
|
6862
|
-
point(.5, .84),
|
|
6863
|
-
point(.32, .97),
|
|
6864
|
-
point(.18, .82),
|
|
6865
|
-
point(.03, .7)
|
|
6866
|
-
])}" fill="${fill}" stroke="${border}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
6993
|
+
return `<path d="M ${format(first.x)} ${format(first.y)} ${arcs.join(" ")} Z" fill="${fill}" stroke="${border}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
6867
6994
|
}
|
|
6868
6995
|
function thoughtTrail(body, bodyCenter, tip, fill, border, dreaming) {
|
|
6869
6996
|
const tipVector = subtract(tip, bodyCenter);
|
|
@@ -10383,7 +10510,7 @@ function createBubbleComposition(options) {
|
|
|
10383
10510
|
});
|
|
10384
10511
|
}
|
|
10385
10512
|
//#endregion
|
|
10386
|
-
//#region node_modules/.pnpm/@kubohiroya+turbowarp-svg-text@0.
|
|
10513
|
+
//#region node_modules/.pnpm/@kubohiroya+turbowarp-svg-text@0.14.0/node_modules/@kubohiroya/turbowarp-svg-text/dist/composition.js
|
|
10387
10514
|
var block_definitions_default = {
|
|
10388
10515
|
extensionName: "SVG Text",
|
|
10389
10516
|
blocks: [{
|
|
@@ -12303,9 +12430,11 @@ function createSvgOverlaySurface(manager, actor, actorKey, kind, style, schedule
|
|
|
12303
12430
|
const indicatorSize = fitImage(continueIndicator, indicatorBoxSize$1, scaleMultiplier);
|
|
12304
12431
|
const totalWidth = portraitSize.width + (hasPortrait ? contentGap$1 * scaleMultiplier : 0) + textSize.width;
|
|
12305
12432
|
const contentHeight = Math.max(portraitSize.height, textSize.height);
|
|
12306
|
-
const
|
|
12307
|
-
|
|
12308
|
-
|
|
12433
|
+
const { width: baseBubbleWidth, height: baseBubbleHeight } = bubbleBodySizeForContent({
|
|
12434
|
+
contentWidth: totalWidth / scaleMultiplier,
|
|
12435
|
+
contentHeight: contentHeight / scaleMultiplier,
|
|
12436
|
+
styles: [currentStyle.visualStyle, ...shapeTransition === void 0 ? [] : [shapeTransition.from, shapeTransition.to]]
|
|
12437
|
+
});
|
|
12309
12438
|
const bubbleWidth = Math.max(totalWidth, (baseBubbleWidth - 48) * scaleMultiplier);
|
|
12310
12439
|
const bubbleHeight = Math.max(contentHeight, (baseBubbleHeight - 48) * scaleMultiplier);
|
|
12311
12440
|
const stageLeft = -native.width / 2;
|
|
@@ -12943,9 +13072,11 @@ function createSurface(runtime, actor, actorKey, kind, style, scheduler) {
|
|
|
12943
13072
|
};
|
|
12944
13073
|
const totalWidth = portraitSize.width + (hasPortrait ? contentGap * scaleMultiplier : 0) + textSize.width;
|
|
12945
13074
|
const contentHeight = Math.max(portraitSize.height, textSize.height);
|
|
12946
|
-
const
|
|
12947
|
-
|
|
12948
|
-
|
|
13075
|
+
const { width: baseBubbleWidth, height: baseBubbleHeight } = bubbleBodySizeForContent({
|
|
13076
|
+
contentWidth: totalWidth / scaleMultiplier,
|
|
13077
|
+
contentHeight: contentHeight / scaleMultiplier,
|
|
13078
|
+
styles: [currentStyle.visualStyle, ...shapeTransition === void 0 ? [] : [shapeTransition.from, shapeTransition.to]]
|
|
13079
|
+
});
|
|
12949
13080
|
const bubbleWidth = Math.max(totalWidth, (baseBubbleWidth - 48) * scaleMultiplier);
|
|
12950
13081
|
const bubbleHeight = Math.max(contentHeight, (baseBubbleHeight - 48) * scaleMultiplier);
|
|
12951
13082
|
const nativeSize = renderer.getNativeSize();
|
|
@@ -13462,7 +13593,7 @@ var builtInBubbleStyles = Object.freeze([Object.freeze({
|
|
|
13462
13593
|
textStyle: "default"
|
|
13463
13594
|
})]);
|
|
13464
13595
|
var EXTENSION_DOCS_URI = "https://kubohiroya.github.io/turbowarp-bubble/";
|
|
13465
|
-
var EXTENSION_VERSION = "0.
|
|
13596
|
+
var EXTENSION_VERSION = "0.17.1";
|
|
13466
13597
|
var BLOCK_ICON_URI = extensionConfig$1.blockIconURI;
|
|
13467
13598
|
function extensionError(message) {
|
|
13468
13599
|
const error = /* @__PURE__ */ new Error(`[Bubble] ${message}`);
|
|
@@ -5,6 +5,21 @@ export declare function bubbleBodyMinimumSize(...styles: readonly BubbleVisualSt
|
|
|
5
5
|
height: number;
|
|
6
6
|
width: number;
|
|
7
7
|
}>;
|
|
8
|
+
/** Gap kept between the content box and the inside of the outline stroke. */
|
|
9
|
+
export declare const bubbleContentClearance = 6;
|
|
10
|
+
/**
|
|
11
|
+
* Computes the Bubble SVG size whose visible outline encloses a content box of
|
|
12
|
+
* the given size with {@link bubbleContentClearance} to spare, for every listed
|
|
13
|
+
* style (all styles of a shape transition must fit the same content).
|
|
14
|
+
*/
|
|
15
|
+
export declare function bubbleBodySizeForContent(input: {
|
|
16
|
+
readonly contentWidth: number;
|
|
17
|
+
readonly contentHeight: number;
|
|
18
|
+
readonly styles: readonly BubbleVisualStyle[];
|
|
19
|
+
}): Readonly<{
|
|
20
|
+
height: number;
|
|
21
|
+
width: number;
|
|
22
|
+
}>;
|
|
8
23
|
export interface RenderBubbleSvgInput {
|
|
9
24
|
readonly style: BubbleVisualStyle;
|
|
10
25
|
readonly lines: readonly string[];
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<rect x="344" y="118" width="296" height="280" rx="18" fill="#ffffff" stroke="#d9deea" stroke-width="2"/>
|
|
31
31
|
<text x="360" y="150" style="fill:#25283a;font-size:18px;font-weight:700">THINKING</text>
|
|
32
32
|
<svg x="352" y="162" width="280" height="170" viewBox="0 0 280 170" data-bubble-renderer="canonical" data-bubble-style="THINKING" overflow="visible">
|
|
33
|
-
<title>THINKING visual style example</title><circle cx="92.12515224204833" cy="153.37236839860094" r="5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="88.82135196866629" cy="158.0906841737055" r="3.5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><g transform="translate(0 0) scale(1)"><path d="M
|
|
33
|
+
<title>THINKING visual style example</title><circle cx="92.12515224204833" cy="153.37236839860094" r="5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="88.82135196866629" cy="158.0906841737055" r="3.5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><g transform="translate(0 0) scale(1)"><path d="M 140.0000 37.6000 A 22.8443 22.8443 0 0 1 180.7807 38.6198 A 17.7879 17.7879 0 0 1 212.0994 43.9204 A 24.2761 24.2761 0 0 1 242.0987 75.2138 A 19.7487 19.7487 0 0 1 237.0472 110.1158 A 23.6076 23.6076 0 0 1 199.4021 129.0899 A 18.2626 18.2626 0 0 1 166.9306 132.1108 A 27.4222 27.4222 0 0 1 117.9625 132.2420 A 20.9985 20.9985 0 0 1 80.5979 129.0899 A 22.3920 22.3920 0 0 1 44.4094 112.0825 A 17.4181 17.4181 0 0 1 37.6112 81.7307 A 24.1082 24.1082 0 0 1 61.7416 46.0789 A 20.0377 20.0377 0 0 1 96.7791 38.8191 A 24.2133 24.2133 0 0 1 140.0000 37.6000 Z" fill="#fff4cc" stroke="#6f5b45" stroke-width="3" stroke-linejoin="round"/></g><text x="140" y="89.9" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">どうしようかな…</text>
|
|
34
34
|
</svg>
|
|
35
35
|
<text x="492" y="350" text-anchor="middle" class="small">思考</text>
|
|
36
36
|
<text x="492" y="368" text-anchor="middle" class="small">雲形本体+小さな丸のtrail</text>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<rect x="656" y="118" width="296" height="280" rx="18" fill="#ffffff" stroke="#d9deea" stroke-width="2"/>
|
|
41
41
|
<text x="672" y="150" style="fill:#25283a;font-size:18px;font-weight:700">DREAMING</text>
|
|
42
42
|
<svg x="664" y="162" width="280" height="170" viewBox="0 0 280 170" data-bubble-renderer="canonical" data-bubble-style="DREAMING" overflow="visible">
|
|
43
|
-
<title>DREAMING visual style example</title><circle cx="92.64137103476426" cy="152.63513155874082" r="7" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="89.23432700283905" cy="157.50089470181746" r="4.5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="86.96296431488891" cy="160.74473679720185" r="3" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><g transform="translate(0 0) scale(1)"><path d="M
|
|
43
|
+
<title>DREAMING visual style example</title><circle cx="92.64137103476426" cy="152.63513155874082" r="7" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="89.23432700283905" cy="157.50089470181746" r="4.5" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><circle cx="86.96296431488891" cy="160.74473679720185" r="3" fill="#fff4cc" stroke="#6f5b45" stroke-width="2"/><g transform="translate(0 0) scale(1)"><path d="M 140.0000 37.6000 A 22.8443 22.8443 0 0 1 180.7807 38.6198 A 17.7879 17.7879 0 0 1 212.0994 43.9204 A 24.2761 24.2761 0 0 1 242.0987 75.2138 A 19.7487 19.7487 0 0 1 237.0472 110.1158 A 23.6076 23.6076 0 0 1 199.4021 129.0899 A 18.2626 18.2626 0 0 1 166.9306 132.1108 A 27.4222 27.4222 0 0 1 117.9625 132.2420 A 20.9985 20.9985 0 0 1 80.5979 129.0899 A 22.3920 22.3920 0 0 1 44.4094 112.0825 A 17.4181 17.4181 0 0 1 37.6112 81.7307 A 24.1082 24.1082 0 0 1 61.7416 46.0789 A 20.0377 20.0377 0 0 1 96.7791 38.8191 A 24.2133 24.2133 0 0 1 140.0000 37.6000 Z" fill="#fff4cc" stroke="#6f5b45" stroke-width="3" stroke-linejoin="round"/></g><text x="140" y="89.9" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">いつか空の向こうへ</text>
|
|
44
44
|
</svg>
|
|
45
45
|
<text x="804" y="350" text-anchor="middle" class="small">夢・回想</text>
|
|
46
46
|
<text x="804" y="368" text-anchor="middle" class="small">柔らかな雲形+長い丸trail</text>
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
<rect x="32" y="130" width="504" height="390" rx="18" fill="#ffffff" stroke="#d9deea" stroke-width="2"/>
|
|
21
21
|
<text x="52" y="166" style="fill:#25283a;font-size:19px;font-weight:700">maxWidth = 128px</text>
|
|
22
22
|
<text x="516" y="165" text-anchor="end" class="small">4 lines</text>
|
|
23
|
-
<svg x="
|
|
24
|
-
<title>maxWidth 128 wrapping example</title><path d="M 39.1842
|
|
23
|
+
<svg x="182" y="212" width="200" height="147.60000000000002" viewBox="0 0 200 147.60000000000002" data-bubble-renderer="canonical" data-bubble-style="NORMAL" overflow="visible">
|
|
24
|
+
<title>maxWidth 128 wrapping example</title><path d="M 39.1842 123.3784 L 36.4377 122.7190 L 33.8282 121.6381 L 31.4199 120.1623 L 29.2721 118.3279 L 27.4377 116.1801 L 25.9619 113.7718 L 24.8810 111.1623 L 24.2216 108.4158 L 24.0000 105.6000 L 24.0000 42.0000 L 24.2216 39.1842 L 24.8810 36.4377 L 25.9619 33.8282 L 27.4377 31.4199 L 29.2721 29.2721 L 31.4199 27.4377 L 33.8282 25.9619 L 36.4377 24.8810 L 39.1842 24.2216 L 42.0000 24.0000 L 158.0000 24.0000 L 160.8158 24.2216 L 163.5623 24.8810 L 166.1718 25.9619 L 168.5801 27.4377 L 170.7279 29.2721 L 172.5623 31.4199 L 174.0381 33.8282 L 175.1190 36.4377 L 175.7784 39.1842 L 176.0000 42.0000 L 176.0000 105.6000 L 175.7784 108.4158 L 175.1190 111.1623 L 174.0381 113.7718 L 172.5623 116.1801 L 170.7279 118.3279 L 168.5801 120.1623 L 166.1718 121.6381 L 163.5623 122.7190 L 160.8158 123.3784 L 158.0000 123.6000 L 85.7779 123.6000 L 69.1707 139.9135 L 67.7779 123.6000 L 42.0000 123.6000 Z" fill="#fff4cc" stroke="#6f5b45" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" /><text x="100" y="50.35000000000001" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">新しいキャラク</text><text x="100" y="69.25000000000001" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">ターが、静かな夜</text><text x="100" y="88.15" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">の港へ歩いてきま</text><text x="100" y="107.05000000000001" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">した。</text>
|
|
25
25
|
</svg>
|
|
26
26
|
<line x1="218" y1="468" x2="346" y2="468" stroke="#ef476f" stroke-width="2"/>
|
|
27
27
|
<path d="M 224 463 L 218 468 L 224 473 M 340 463 L 346 468 L 340 473" fill="none" stroke="#ef476f" stroke-width="2"/>
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<rect x="552" y="130" width="504" height="390" rx="18" fill="#ffffff" stroke="#d9deea" stroke-width="2"/>
|
|
32
32
|
<text x="572" y="166" style="fill:#25283a;font-size:19px;font-weight:700">maxWidth = 224px</text>
|
|
33
33
|
<text x="1036" y="165" text-anchor="end" class="small">2 lines</text>
|
|
34
|
-
<svg x="
|
|
35
|
-
<title>maxWidth 224 wrapping example</title><path d="M 39.1842
|
|
34
|
+
<svg x="654" y="212" width="296" height="109.80000000000001" viewBox="0 0 296 109.80000000000001" data-bubble-renderer="canonical" data-bubble-style="NORMAL" overflow="visible">
|
|
35
|
+
<title>maxWidth 224 wrapping example</title><path d="M 39.1842 85.5784 L 36.4377 84.9190 L 33.8282 83.8381 L 31.4199 82.3623 L 29.2721 80.5279 L 27.4377 78.3801 L 25.9619 75.9718 L 24.8810 73.3623 L 24.2216 70.6158 L 24.0000 67.8000 L 24.0000 42.0000 L 24.2216 39.1842 L 24.8810 36.4377 L 25.9619 33.8282 L 27.4377 31.4199 L 29.2721 29.2721 L 31.4199 27.4377 L 33.8282 25.9619 L 36.4377 24.8810 L 39.1842 24.2216 L 42.0000 24.0000 L 254.0000 24.0000 L 256.8158 24.2216 L 259.5623 24.8810 L 262.1718 25.9619 L 264.5801 27.4377 L 266.7279 29.2721 L 268.5623 31.4199 L 270.0381 33.8282 L 271.1190 36.4377 L 271.7784 39.1842 L 272.0000 42.0000 L 272.0000 67.8000 L 271.7784 70.6158 L 271.1190 73.3623 L 270.0381 75.9718 L 268.5623 78.3801 L 266.7279 80.5279 L 264.5801 82.3623 L 262.1718 83.8381 L 259.5623 84.9190 L 256.8158 85.5784 L 254.0000 85.8000 L 142.5911 85.8000 L 125.9840 102.1135 L 124.5911 85.8000 L 42.0000 85.8000 Z" fill="#fff4cc" stroke="#6f5b45" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" /><text x="148" y="50.35" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">新しいキャラクターが、静かな</text><text x="148" y="69.25" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">夜の港へ歩いてきました。</text>
|
|
36
36
|
</svg>
|
|
37
37
|
<line x1="690" y1="468" x2="914" y2="468" stroke="#ef476f" stroke-width="2"/>
|
|
38
38
|
<path d="M 696 463 L 690 468 L 696 473 M 908 463 L 914 468 L 908 473" fill="none" stroke="#ef476f" stroke-width="2"/>
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
<rect x="1072" y="130" width="504" height="390" rx="18" fill="#ffffff" stroke="#d9deea" stroke-width="2"/>
|
|
43
43
|
<text x="1092" y="166" style="fill:#25283a;font-size:19px;font-weight:700">maxWidth = 320px</text>
|
|
44
44
|
<text x="1556" y="165" text-anchor="end" class="small">2 lines</text>
|
|
45
|
-
<svg x="
|
|
46
|
-
<title>maxWidth 320 wrapping example</title><path d="M 39.1842
|
|
45
|
+
<svg x="1126" y="212" width="392" height="109.80000000000001" viewBox="0 0 392 109.80000000000001" data-bubble-renderer="canonical" data-bubble-style="NORMAL" overflow="visible">
|
|
46
|
+
<title>maxWidth 320 wrapping example</title><path d="M 39.1842 85.5784 L 36.4377 84.9190 L 33.8282 83.8381 L 31.4199 82.3623 L 29.2721 80.5279 L 27.4377 78.3801 L 25.9619 75.9718 L 24.8810 73.3623 L 24.2216 70.6158 L 24.0000 67.8000 L 24.0000 42.0000 L 24.2216 39.1842 L 24.8810 36.4377 L 25.9619 33.8282 L 27.4377 31.4199 L 29.2721 29.2721 L 31.4199 27.4377 L 33.8282 25.9619 L 36.4377 24.8810 L 39.1842 24.2216 L 42.0000 24.0000 L 350.0000 24.0000 L 352.8158 24.2216 L 355.5623 24.8810 L 358.1718 25.9619 L 360.5801 27.4377 L 362.7279 29.2721 L 364.5623 31.4199 L 366.0381 33.8282 L 367.1190 36.4377 L 367.7784 39.1842 L 368.0000 42.0000 L 368.0000 67.8000 L 367.7784 70.6158 L 367.1190 73.3623 L 366.0381 75.9718 L 364.5623 78.3801 L 362.7279 80.5279 L 360.5801 82.3623 L 358.1718 83.8381 L 355.5623 84.9190 L 352.8158 85.5784 L 350.0000 85.8000 L 190.5911 85.8000 L 173.9840 102.1135 L 172.5911 85.8000 L 42.0000 85.8000 Z" fill="#fff4cc" stroke="#6f5b45" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" /><text x="196" y="50.35" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">新しいキャラクターが、静かな夜の港へ歩い</text><text x="196" y="69.25" text-anchor="middle" fill="#25283a" font-family="Noto Sans JP, sans-serif" font-size="14">てきました。</text>
|
|
47
47
|
</svg>
|
|
48
48
|
<line x1="1162" y1="468" x2="1482" y2="468" stroke="#ef476f" stroke-width="2"/>
|
|
49
49
|
<path d="M 1168 463 L 1162 468 L 1168 473 M 1476 463 L 1482 468 L 1476 473" fill="none" stroke="#ef476f" stroke-width="2"/>
|
package/docs/block-manual.ja.md
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
|
|
9
9
|
## 1. 必要な拡張機能
|
|
10
10
|
|
|
11
|
-
入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.
|
|
11
|
+
入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.14.0のhost-neutral layout providerをbundle内に持ち、既定のSVG overlayではskinを作りません。portrait、lip-sync、continue indicator、フルボイス、表示効果音などのメディアアセットにはAsset Cacheが必要です。Async InputとRuntime Expressionはconditionを使うBubble待機またはclose policyで必要です。timeoutだけのclose policyにはどちらも不要です。
|
|
12
12
|
|
|
13
|
-
| 順番 | 拡張機能
|
|
14
|
-
| ---: |
|
|
15
|
-
| 1 | Temporary Variables
|
|
16
|
-
| 2 | Async Input 0.
|
|
17
|
-
| 3 | Runtime Expression 0.
|
|
18
|
-
| 4 | Asset Cache 0.
|
|
19
|
-
| 5 | Bubble 0.
|
|
13
|
+
| 順番 | 拡張機能 | 読み込み先 |
|
|
14
|
+
| ---: | ------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| 1 | Temporary Variables | TurboWarpの拡張機能ライブラリから追加 |
|
|
16
|
+
| 2 | Async Input 0.12.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async-input.js` |
|
|
17
|
+
| 3 | Runtime Expression 0.10.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js` |
|
|
18
|
+
| 4 | Asset Cache 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.7.0/dist/asset-cache.js` |
|
|
19
|
+
| 5 | Bubble 0.17.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.17.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
|
|
|
@@ -59,7 +59,7 @@ URL画像を使う場合は、`RESOURCE_ID`へHTTPS URLを指定します。Bubb
|
|
|
59
59
|
|
|
60
60
|
## 3. 文字layout styleを選ぶ
|
|
61
61
|
|
|
62
|
-
standalone BubbleはSVG Text 0.
|
|
62
|
+
standalone BubbleはSVG Text 0.14.0のlayout compositionを内包し、2つのBubble styleを組み込みます。`say`はspeech本体とspeech tail、`think`はthought本体とround trailを持ち、本体とtail/trailの形は別項目ではなく1つのvisual styleとして選びます。短い`say [MESSAGE]`/`think [MESSAGE]`ブロックが対応styleを自動選択するため、基本経路にはstyle定義もstyle入力も不要です。どちらも予約text profile `default`、内容に追従するサイズ、14px Helvetica、右側優先・収まりに応じた左反転、block入力の330文字上限、空文字でのcloseを使います。4pxのSVG strokeを白いfillより先に描き、内側半分を隠すことで、見かけの輪郭をTurboWarp標準と同じ細さにします。それ以外のtext style名やstyle設定ブロックを使うとcustom profileになります。custom text styleは初回参照時に背景透明のSVG Text既定styleとして初期化されます。stock SVG Text 0.14.0をBubbleより先に別拡張として読み込んだprojectでは、Bubbleが公開`getLayoutCapability()`を使い、SVG Text blockで定義したnamed styleを維持します。handoffのない古いSVG Textがロード済みならstyleを黙って置換せず互換errorを返し、必要な場合だけ文書化済みscratch-render fallbackを選択します。
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
define bubble style [hero-dialogue] using text style [default]
|
|
@@ -328,7 +328,7 @@ cloneが停止・削除された場合は、そのtargetに属するtimer、over
|
|
|
328
328
|
|
|
329
329
|
| 状況 | 原因と対処 |
|
|
330
330
|
| ------------------------------------ | ------------------------------------------------------------------------ |
|
|
331
|
-
| Asset Cacheを要求するエラー | 画像・メディアアセットを使う前にAsset Cache 0.
|
|
331
|
+
| Asset Cacheを要求するエラー | 画像・メディアアセットを使う前にAsset Cache 0.7.0を読み込む |
|
|
332
332
|
| SVG overlay backendのエラー | `renderer.addOverlay()`対応hostを使うか`scratch-render`を明示する |
|
|
333
333
|
| Async Inputを要求するエラー | Bubble待機より前にAsync Input 0.3.xをサンドボックスなしで読み込む |
|
|
334
334
|
| Runtime Expressionを要求するエラー | Bubble待機より前にRuntime Expression 0.3.xをサンドボックスなしで読み込む |
|
package/docs/block-manual.md
CHANGED
|
@@ -8,15 +8,15 @@ This manual explains how to use `turbowarp-bubble` as an unsandboxed TurboWarp c
|
|
|
8
8
|
|
|
9
9
|
## 1. Load the required extensions
|
|
10
10
|
|
|
11
|
-
The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with **Run without sandbox** enabled. Bubble bundles the host-neutral SVG Text 0.
|
|
11
|
+
The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with **Run without sandbox** enabled. Bubble bundles the host-neutral SVG Text 0.14.0 layout provider and creates no text skin on its default SVG overlay. Asset Cache is required for portrait, lip-sync, continue indicator, voice, and display-sound assets. Async Input and Runtime Expression are required only for condition-based Bubble waits and close policies; a timeout-only close policy needs neither.
|
|
12
12
|
|
|
13
|
-
| Order | Extension
|
|
14
|
-
| ----: |
|
|
15
|
-
| 1 | Temporary Variables
|
|
16
|
-
| 2 | Async Input 0.
|
|
17
|
-
| 3 | Runtime Expression 0.
|
|
18
|
-
| 4 | Asset Cache 0.
|
|
19
|
-
| 5 | Bubble 0.
|
|
13
|
+
| Order | Extension | URL |
|
|
14
|
+
| ----: | ------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| 1 | Temporary Variables | Add from the TurboWarp extension library |
|
|
16
|
+
| 2 | Async Input 0.12.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async-input.js` |
|
|
17
|
+
| 3 | Runtime Expression 0.10.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js` |
|
|
18
|
+
| 4 | Asset Cache 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.7.0/dist/asset-cache.js` |
|
|
19
|
+
| 5 | Bubble 0.17.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.17.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
|
|
|
@@ -59,7 +59,7 @@ For a remote image, pass its HTTPS URL as `RESOURCE_ID`. Bubble accepts only ass
|
|
|
59
59
|
|
|
60
60
|
## 3. Select a text layout style
|
|
61
61
|
|
|
62
|
-
Standalone Bubble bundles the SVG Text 0.
|
|
62
|
+
Standalone Bubble bundles the SVG Text 0.14.0 layout composition and installs two Bubble styles: `say` owns the speech body and speech tail, while `think` owns the thought body and round trail. A style's body and tail/trail shapes are one visual choice, not separately selected properties. The short `say [MESSAGE]` and `think [MESSAGE]` blocks select the matching style automatically, so the basic path needs neither a style definition nor a style input. Both styles use the reserved text profile `default`, a content-sized body, 14px Helvetica text, right-first placement with a fit-dependent left flip, 330-character block-input limit, and empty-message close behavior. Their 4px SVG stroke is painted before the white fill, hiding the inner half so the visible outline matches TurboWarp's standard bubble. Any other text style name or explicit style-setting block selects the custom profile. Custom text styles are initialized on first use with transparent-background SVG Text defaults. If a project separately loads the stock SVG Text 0.14.0 extension before Bubble, Bubble uses its public `getLayoutCapability()` instead and preserves the named styles defined by SVG Text blocks. An older loaded SVG Text extension without that handoff produces an explicit compatibility error rather than silently replacing the style; select the documented scratch-render fallback only when needed.
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
define bubble style [hero-dialogue] using text style [default]
|
|
@@ -328,7 +328,7 @@ Saved projects using the former `say/think [MESSAGE] with bubble style [STYLE]`
|
|
|
328
328
|
|
|
329
329
|
| Symptom | Cause and solution |
|
|
330
330
|
| ------------------------------------ | ------------------------------------------------------------------------------- |
|
|
331
|
-
| Asset Cache required error | Load Asset Cache 0.
|
|
331
|
+
| Asset Cache required error | Load Asset Cache 0.7.0 without sandbox before using image/media assets |
|
|
332
332
|
| SVG overlay backend error | Use a host with `renderer.addOverlay()` or explicitly select `scratch-render` |
|
|
333
333
|
| Async Input required error | Load Async Input 0.3.x without sandbox before using the Bubble wait |
|
|
334
334
|
| Runtime Expression required error | Load Runtime Expression 0.3.x without sandbox before using the Bubble wait |
|
package/docs/index.html
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
</blockquote>
|
|
66
66
|
<p><img src="./assets/block-quick-start.svg" alt="A quick-start block sequence that registers Next1 and Next2 separately, prepares input listeners, then uses Bubble's integrated wait"></p>
|
|
67
67
|
<h2 id="requirements">1. Load the required extensions</h2>
|
|
68
|
-
<p>The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with <strong>Run without sandbox</strong> enabled. Bubble bundles the host-neutral SVG Text 0.
|
|
68
|
+
<p>The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with <strong>Run without sandbox</strong> enabled. Bubble bundles the host-neutral SVG Text 0.14.0 layout provider and creates no text skin on its default SVG overlay. Asset Cache is required for portrait, lip-sync, continue indicator, voice, and display-sound assets. Async Input and Runtime Expression are required only for condition-based Bubble waits and close policies; a timeout-only close policy needs neither.</p>
|
|
69
69
|
<table>
|
|
70
70
|
<thead>
|
|
71
71
|
<tr>
|
|
@@ -81,23 +81,23 @@
|
|
|
81
81
|
</tr>
|
|
82
82
|
<tr>
|
|
83
83
|
<td align="right">2</td>
|
|
84
|
-
<td>Async Input 0.
|
|
85
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.
|
|
84
|
+
<td>Async Input 0.12.0</td>
|
|
85
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.12.0/dist/async-input.js</code></td>
|
|
86
86
|
</tr>
|
|
87
87
|
<tr>
|
|
88
88
|
<td align="right">3</td>
|
|
89
|
-
<td>Runtime Expression 0.
|
|
90
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.
|
|
89
|
+
<td>Runtime Expression 0.10.0</td>
|
|
90
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.10.0/dist/runtime-expression.js</code></td>
|
|
91
91
|
</tr>
|
|
92
92
|
<tr>
|
|
93
93
|
<td align="right">4</td>
|
|
94
|
-
<td>Asset Cache 0.
|
|
95
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.
|
|
94
|
+
<td>Asset Cache 0.7.0</td>
|
|
95
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.7.0/dist/asset-cache.js</code></td>
|
|
96
96
|
</tr>
|
|
97
97
|
<tr>
|
|
98
98
|
<td align="right">5</td>
|
|
99
|
-
<td>Bubble 0.
|
|
100
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.
|
|
99
|
+
<td>Bubble 0.17.1</td>
|
|
100
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.17.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'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>
|
|
@@ -166,7 +166,7 @@ register resource [costume:Assets:Next2] as asset [Next2]
|
|
|
166
166
|
</code></pre>
|
|
167
167
|
<p>For a remote image, pass its HTTPS URL as <code>RESOURCE_ID</code>. Bubble accepts only assets already registered with Asset Cache whose MIME type is <code>image/*</code>.</p>
|
|
168
168
|
<h2 id="text-style">3. Select a text layout style</h2>
|
|
169
|
-
<p>Standalone Bubble bundles the SVG Text 0.
|
|
169
|
+
<p>Standalone Bubble bundles the SVG Text 0.14.0 layout composition and installs two Bubble styles: <code>say</code> owns the speech body and speech tail, while <code>think</code> owns the thought body and round trail. A style's body and tail/trail shapes are one visual choice, not separately selected properties. The short <code>say [MESSAGE]</code> and <code>think [MESSAGE]</code> blocks select the matching style automatically, so the basic path needs neither a style definition nor a style input. Both styles use the reserved text profile <code>default</code>, a content-sized body, 14px Helvetica text, right-first placement with a fit-dependent left flip, 330-character block-input limit, and empty-message close behavior. Their 4px SVG stroke is painted before the white fill, hiding the inner half so the visible outline matches TurboWarp's standard bubble. Any other text style name or explicit style-setting block selects the custom profile. Custom text styles are initialized on first use with transparent-background SVG Text defaults. If a project separately loads the stock SVG Text 0.14.0 extension before Bubble, Bubble uses its public <code>getLayoutCapability()</code> instead and preserves the named styles defined by SVG Text blocks. An older loaded SVG Text extension without that handoff produces an explicit compatibility error rather than silently replacing the style; select the documented scratch-render fallback only when needed.</p>
|
|
170
170
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [default]
|
|
171
171
|
</code></pre>
|
|
172
172
|
<p>Application hosts that need custom fonts, colors, or alignment can define styles on <code>createSvgTextLayoutComposition()</code> and inject them through <code>createSvgTextOverlayTextCapability()</code>. The custom profile uses the same <code>layoutText()</code> API and does not create an SVG text skin on the default overlay backend. Bubble owns placement, tail, and outer shape.</p>
|
|
@@ -499,7 +499,7 @@ animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
|
499
499
|
</thead>
|
|
500
500
|
<tbody><tr>
|
|
501
501
|
<td>Asset Cache required error</td>
|
|
502
|
-
<td>Load Asset Cache 0.
|
|
502
|
+
<td>Load Asset Cache 0.7.0 without sandbox before using image/media assets</td>
|
|
503
503
|
</tr>
|
|
504
504
|
<tr>
|
|
505
505
|
<td>SVG overlay backend error</td>
|