From 8a578f5ce3b8e7e8f650369f1e9e19bcbb66e1ae Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 30 Jul 2025 08:58:30 -0700 Subject: [PATCH] fix: Allow overriding `VariableModel` via `options.plugins`. (#9257) --- core/registry.ts | 6 +++--- core/variable_map.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/registry.ts b/core/registry.ts index 2b00b775d..4980a5594 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -119,9 +119,9 @@ export class Type<_T> { /** @internal */ static PASTER = new Type>>('paster'); - static VARIABLE_MODEL = new Type>( - 'variableModel', - ); + static VARIABLE_MODEL = new Type< + IVariableModelStatic & IVariableModel + >('variableModel'); static VARIABLE_MAP = new Type>>( 'variableMap', diff --git a/core/variable_map.ts b/core/variable_map.ts index 3dd4bf547..ba36dcea6 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -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) {