mirror of
https://github.com/google/blockly.git
synced 2026-06-02 01:10:08 +02:00
fix: typo in unregisterWorkspace (#9936)
* fix: Fix typo in unregisterWorkspace function name * fix: Add deprecation warning for unregisterWorkpace function * fix: Add renaming entry for unregisterWorkspace in version 13.0.0 * fix(typo): "." -> "," in renamings.json5 Co-authored-by: Maribeth Moffatt <mebottorff@gmail.com> * fix(workspace): Correct typo in `unregisterWorkspace` method call * chore: change v12 to v13 * chore: update import --------- Co-authored-by: Woosuk Nam <me@suk.kr>
This commit is contained in:
@@ -15,6 +15,7 @@ import * as eventUtils from './events/utils.js';
|
||||
import {getFocusManager} from './focus_manager.js';
|
||||
import {ISelectable, isSelectable} from './interfaces/i_selectable.js';
|
||||
import {ShortcutRegistry} from './shortcut_registry.js';
|
||||
import * as deprecation from './utils/deprecation.js';
|
||||
import type {Workspace} from './workspace.js';
|
||||
import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
|
||||
@@ -58,10 +59,27 @@ export function registerWorkspace(workspace: Workspace) {
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
export function unregisterWorkpace(workspace: Workspace) {
|
||||
export function unregisterWorkspace(workspace: Workspace) {
|
||||
delete WorkspaceDB_[workspace.id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a workspace from the workspace db.
|
||||
*
|
||||
* @deprecated v13: use Blockly.common.unregisterWorkspace
|
||||
* @param workspace
|
||||
*/
|
||||
export function unregisterWorkpace(workspace: Workspace) {
|
||||
deprecation.warn(
|
||||
'Blockly.common.unregisterWorkpace',
|
||||
'v13',
|
||||
'v14',
|
||||
'Blockly.common.unregisterWorkspace',
|
||||
);
|
||||
|
||||
unregisterWorkspace(workspace);
|
||||
}
|
||||
|
||||
/**
|
||||
* The main workspace most recently used.
|
||||
* Set by Blockly.WorkspaceSvg.prototype.markFocused
|
||||
|
||||
@@ -167,7 +167,7 @@ export class Workspace {
|
||||
this.listeners.length = 0;
|
||||
this.clear();
|
||||
// Remove from workspace database.
|
||||
common.unregisterWorkpace(this);
|
||||
common.unregisterWorkspace(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1595,5 +1595,16 @@
|
||||
},
|
||||
],
|
||||
|
||||
'13.0.0': [
|
||||
{
|
||||
oldName: 'Blockly.common',
|
||||
exports: {
|
||||
unregisterWorkpace: {
|
||||
newExport: 'unregisterWorkspace',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
'develop': [],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user