import utils from '../utils';
export default class InlineNode {
    constructor(arena) {
        this.arena = arena;
        this.hasParent = false;
        this.hasChildren = false;
        this.hasText = false;
        this.inline = true;
        this.single = false;
        this.attributes = {};
    }
    getTemplate() {
        return this.arena.getTemplate(undefined, '', this.attributes);
    }
    getAttributesString() {
        let result = utils.attr.getStringsFromAttributes(this.attributes);
        result = result.concat(utils.attr.getStringsFromAttributes(this.arena.attributes));
        return result.join(' ');
    }
    getTags() {
        const attrs = this.getAttributesString();
        const tag = this.arena.tag.toLowerCase();
        return [`<${tag.toLowerCase()}${attrs}>`, `</${tag.toLowerCase()}>`];
    }
    getDataHtml() {
        return this.arena.getDataHtml('', this.attributes);
    }
    setAttribute(name, value) {
        this.attributes[name] = value;
    }
    getAttribute(name) {
        return this.attributes[name] || '';
    }
    clone() {
        const newNode = new InlineNode(this.arena);
        Object.entries(this.attributes).forEach(([name, value]) => {
            newNode.setAttribute(name, value);
        });
        return newNode;
    }
}
//# sourceMappingURL=InlineNode.js.map