mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
* feat!: Make bubbles, comments, and icons focusable * feat!: Make ISelectable and ICopyable focusable. * feat: Consolidate selection calls. Now everything is based on focus with selection only being used as a proxy. * feat: Invert responsibility for setSelected(). Now setSelected() is only for quasi-external use. * feat: Push up shadow check to getters. Needed new common-level helper. * chore: Lint fixes. * feat!: Allow IFocusableNode to disable focus. * chore: post-merge lint fixes * fix: Fix tests + text bubble focusing. This fixed then regressed a circular dependency causing the node and advanced compilation steps to fail. This investigation is ongoing. * fix: Clean up & fix imports. This ensures the node and advanced compilation test steps now pass. * fix: Lint fixes + revert commented out logic. * chore: Remove unnecessary cast. Addresses reviewer comment. * fix: Some issues and a bunch of clean-ups. This addresses a bunch of review comments, and fixes selecting workspace comments. * chore: Lint fix. * fix: Remove unnecessary shadow consideration. * chore: Revert import. * chore: Some doc updates & added a warn statement.
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type {IBubble} from './i_bubble';
|
|
|
|
export interface IHasBubble {
|
|
/** @returns True if the bubble is currently open, false otherwise. */
|
|
bubbleIsVisible(): boolean;
|
|
|
|
/** Sets whether the bubble is open or not. */
|
|
setBubbleVisible(visible: boolean): Promise<void>;
|
|
|
|
/**
|
|
* Returns the current IBubble that implementations are managing, or null if
|
|
* there isn't one.
|
|
*
|
|
* Note that this cannot be expected to return null if bubbleIsVisible()
|
|
* returns false, i.e., the nullability of the returned bubble does not
|
|
* necessarily imply visibility.
|
|
*
|
|
* @returns The current IBubble maintained by implementations, or null if
|
|
* there is not one.
|
|
*/
|
|
getBubble(): IBubble | null;
|
|
}
|
|
|
|
/** Type guard that checks whether the given object is a IHasBubble. */
|
|
export function hasBubble(obj: any): obj is IHasBubble {
|
|
return (
|
|
obj.bubbleIsVisible !== undefined && obj.setBubbleVisible !== undefined
|
|
);
|
|
}
|