/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
import { FieldColour, Blockly } from '@kano/kwc-blockly/blockly.js';
import { BlocklyValueStepHelper } from './value.js';
export class ColorFieldStepHelper extends BlocklyValueStepHelper {
    test(challenge, step) {
        if (!super.test(challenge, step)) {
            return false;
        }
        const field = this.getField(challenge, step);
        return field instanceof FieldColour;
    }
    enter(challenge, step) {
        const field = this.getField(challenge, step);
        const block = field.sourceBlock_;
        if (!challenge.workspace) {
            return;
        }
        challenge.workspace.addChangeListener((e) => {
            if (e.type !== Blockly.Events.UI || e.blockId !== block.id) {
                return;
            }
            // TODO: Do something with this or remove this helper
        });
    }
    leave() { }
}
//# sourceMappingURL=color.js.map