/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
import { DialogProvider } from '../../editor/dialogs/dialog-provider.js';
import { EventEmitter, subscribeDOM } from '@kano/common/index.js';
import { KCAddPart } from './kc-add-part.js';
export class AddPartDialogProvider extends DialogProvider {
    constructor() {
        super();
        this.domNode = new KCAddPart();
        this._onDidClickPart = new EventEmitter();
        this._clickSub = subscribeDOM(this.domNode, 'part-click', (e) => {
            this._onDidClickPart.fire(e.detail.type);
        });
    }
    get onDidClickPart() {
        return this._onDidClickPart.event;
    }
    setParts(parts) {
        this.domNode.parts = parts;
    }
    setWhitelist(parts) {
        this.domNode.whitelist = parts;
    }
    createDom() {
        return this.domNode;
    }
    getPartButton(type) {
        return this.domNode.getPartElement(type);
    }
    dispose() {
        this._clickSub.dispose();
    }
}
export default AddPartDialogProvider;
//# sourceMappingURL=add.js.map