mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
chore: deprecate insertion marker manager and related methods (#7797)
This commit is contained in:
@@ -56,6 +56,8 @@ const DUPLICATE_BLOCK_ERROR =
|
||||
* Class that controls updates to connections during drags. It is primarily
|
||||
* responsible for finding the closest eligible connection and highlighting or
|
||||
* unhighlighting it as needed during a drag.
|
||||
*
|
||||
* @deprecated v10 - Use an IConnectionPreviewer instead.
|
||||
*/
|
||||
export class InsertionMarkerManager {
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {IPathObject} from './i_path_object.js';
|
||||
import {RenderInfo} from './info.js';
|
||||
import {MarkerSvg} from './marker_svg.js';
|
||||
import {PathObject} from './path_object.js';
|
||||
import * as deprecation from '../../utils/deprecation.js';
|
||||
|
||||
/**
|
||||
* The base class for a block renderer.
|
||||
@@ -231,12 +232,21 @@ export class Renderer implements IRegistrable {
|
||||
* @param local The connection currently being dragged.
|
||||
* @param topBlock The block currently being dragged.
|
||||
* @returns The preview type to display.
|
||||
*
|
||||
* @deprecated v10 - This function is no longer respected. A custom
|
||||
* IConnectionPreviewer may be able to fulfill the functionality.
|
||||
*/
|
||||
getConnectionPreviewMethod(
|
||||
closest: RenderedConnection,
|
||||
local: RenderedConnection,
|
||||
topBlock: BlockSvg,
|
||||
): PreviewType {
|
||||
deprecation.warn(
|
||||
'getConnectionPreviewMethod',
|
||||
'v10',
|
||||
'v12',
|
||||
'an IConnectionPreviewer, if it fulfills your use case.',
|
||||
);
|
||||
if (
|
||||
local.type === ConnectionType.OUTPUT_VALUE ||
|
||||
local.type === ConnectionType.PREVIOUS_STATEMENT
|
||||
|
||||
@@ -22,6 +22,7 @@ import {Drawer} from './drawer.js';
|
||||
import {RenderInfo} from './info.js';
|
||||
import {MarkerSvg} from './marker_svg.js';
|
||||
import {PathObject} from './path_object.js';
|
||||
import * as deprecation from '../../utils/deprecation.js';
|
||||
|
||||
/**
|
||||
* The zelos renderer. This renderer emulates Scratch-style and MakeCode-style
|
||||
@@ -108,11 +109,21 @@ export class Renderer extends BaseRenderer {
|
||||
return this.constants_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated v10 - This function is no longer respected. A custom
|
||||
* IConnectionPreviewer may be able to fulfill the functionality.
|
||||
*/
|
||||
override getConnectionPreviewMethod(
|
||||
closest: RenderedConnection,
|
||||
local: RenderedConnection,
|
||||
topBlock: BlockSvg,
|
||||
) {
|
||||
deprecation.warn(
|
||||
'getConnectionPreviewMethod',
|
||||
'v10',
|
||||
'v12',
|
||||
'an IConnectionPreviewer, if it fulfills your use case.',
|
||||
);
|
||||
if (local.type === ConnectionType.OUTPUT_VALUE) {
|
||||
if (!closest.isConnected()) {
|
||||
return InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE;
|
||||
|
||||
Reference in New Issue
Block a user