mirror of
https://github.com/google/blockly.git
synced 2026-05-12 23:20:10 +02:00
b0475b0c68
* fix: Remove spurious blank lines Remove extraneous blank lines introduced by deletion of 'use strict'; pragmas. Also fix the location of the goog.declareModuleId call in core/utils/array.ts. * fix: Add missing double-blank-line before body of modules Our convention is to have two blank lines between the imports (or module ID, if there are no imports) and the beginning of the body of the module. Enforce this. * fix: one addition format error for PR #6243
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @fileoverview Base class for events fired as a result of UI actions in
|
|
* Blockly's editor.
|
|
*/
|
|
|
|
/**
|
|
* Base class for events fired as a result of UI actions in
|
|
* Blockly's editor.
|
|
* @class
|
|
*/
|
|
import * as goog from '../../closure/goog/goog.js';
|
|
goog.declareModuleId('Blockly.Events.UiBase');
|
|
|
|
import {Abstract as AbstractEvent} from './events_abstract.js';
|
|
|
|
|
|
/**
|
|
* Base class for a UI event.
|
|
* UI events are events that don't need to be sent over the wire for multi-user
|
|
* editing to work (e.g. scrolling the workspace, zooming, opening toolbox
|
|
* categories).
|
|
* UI events do not undo or redo.
|
|
* @alias Blockly.Events.UiBase
|
|
*/
|
|
export class UiBase extends AbstractEvent {
|
|
override isBlank: boolean;
|
|
override workspaceId: string;
|
|
|
|
// UI events do not undo or redo.
|
|
override recordUndo = false;
|
|
|
|
/** Whether or not the event is a UI event. */
|
|
override isUiEvent = true;
|
|
|
|
/**
|
|
* @param opt_workspaceId The workspace identifier for this event.
|
|
* Undefined for a blank event.
|
|
*/
|
|
constructor(opt_workspaceId?: string) {
|
|
super();
|
|
|
|
/** Whether or not the event is blank (to be populated by fromJson). */
|
|
this.isBlank = typeof opt_workspaceId === 'undefined';
|
|
|
|
/** The workspace identifier for this event. */
|
|
this.workspaceId = opt_workspaceId ? opt_workspaceId : '';
|
|
}
|
|
}
|