UNPKG

@botonic/plugin-flow-builder

Version:

Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.

44 lines 1.65 kB
import { __awaiter } from "tslib"; import { SOURCE_INFO_SEPARATOR } from '../../constants'; import { ContentFieldsBase } from '../content-fields-base'; export class FlowWhatsappButtonListRow extends ContentFieldsBase { constructor() { super(...arguments); this.title = ''; this.description = ''; } static fromHubtypeCMS(component, locale, cmsApi) { const newRow = new FlowWhatsappButtonListRow(component.id); newRow.title = this.getTextByLocale(locale, component.text); newRow.description = this.getTextByLocale(locale, component.description); newRow.targetId = cmsApi.getPayload(component.target); return newRow; } addRowToBotonic(rowIndex, sectionIndex) { if (!this.targetId) { console.error(`Row with title: '${this.title}' has no target`); return undefined; } return { id: this.getRowId(rowIndex, sectionIndex), title: this.title, description: this.description, }; } getRowId(rowIndex, sectionIndex) { return `${this.targetId}${SOURCE_INFO_SEPARATOR}${sectionIndex}.${rowIndex}`; } // eslint-disable-next-line @typescript-eslint/no-unused-vars trackFlow() { return __awaiter(this, void 0, void 0, function* () { // Not apply for this content, because it is a child of the FlowWhatsappButtonList content return; }); } processContent() { return __awaiter(this, void 0, void 0, function* () { return; }); } } //# sourceMappingURL=flow-whatsapp-button-list-row.js.map