mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
feat: text input bubble (#7089)
* feat: add basic text bubble * feat: add resizing the text input bubble * chore: add docs * chore: mouse -> pointer * chore: fixup from PR comments
This commit is contained in:
@@ -45,7 +45,7 @@ export abstract class Bubble implements IBubble {
|
||||
static readonly ANCHOR_RADIUS = 8;
|
||||
|
||||
/** The SVG group containing all parts of the bubble. */
|
||||
private svgRoot: SVGGElement;
|
||||
protected svgRoot: SVGGElement;
|
||||
|
||||
/** The SVG path for the arrow from the anchor to the bubble. */
|
||||
private tail: SVGPathElement;
|
||||
@@ -534,6 +534,20 @@ export abstract class Bubble implements IBubble {
|
||||
steps.push('z');
|
||||
this.tail?.setAttribute('d', steps.join(' '));
|
||||
}
|
||||
/**
|
||||
* Move this bubble to the front of the visible workspace.
|
||||
*
|
||||
* @returns Whether or not the bubble has been moved.
|
||||
* @internal
|
||||
*/
|
||||
bringToFront(): boolean {
|
||||
const svgGroup = this.svgRoot?.parentNode;
|
||||
if (this.svgRoot && svgGroup?.lastChild !== this.svgRoot) {
|
||||
svgGroup?.appendChild(this.svgRoot);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
getRelativeToSurfaceXY(): Coordinate {
|
||||
|
||||
Reference in New Issue
Block a user