mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
fix: Allow overriding VariableModel via options.plugins. (#9257)
This commit is contained in:
@@ -119,9 +119,9 @@ export class Type<_T> {
|
||||
/** @internal */
|
||||
static PASTER = new Type<IPaster<ICopyData, ICopyable<ICopyData>>>('paster');
|
||||
|
||||
static VARIABLE_MODEL = new Type<IVariableModelStatic<IVariableState>>(
|
||||
'variableModel',
|
||||
);
|
||||
static VARIABLE_MODEL = new Type<
|
||||
IVariableModelStatic<IVariableState> & IVariableModel<IVariableState>
|
||||
>('variableModel');
|
||||
|
||||
static VARIABLE_MAP = new Type<IVariableMap<IVariableModel<IVariableState>>>(
|
||||
'variableMap',
|
||||
|
||||
@@ -255,9 +255,9 @@ export class VariableMap
|
||||
}
|
||||
const id = opt_id || idGenerator.genUid();
|
||||
const type = opt_type || '';
|
||||
const VariableModel = registry.getObject(
|
||||
const VariableModel = registry.getClassFromOptions(
|
||||
registry.Type.VARIABLE_MODEL,
|
||||
registry.DEFAULT,
|
||||
this.workspace.options,
|
||||
true,
|
||||
);
|
||||
if (!VariableModel) {
|
||||
|
||||
Reference in New Issue
Block a user