@botonic/plugin-flow-builder
Version:
Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.
38 lines • 1.46 kB
JavaScript
import { __awaiter } from "tslib";
import { ContentFieldsBase } from '../content-fields-base';
import { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row';
export class FlowWhatsappButtonListSection extends ContentFieldsBase {
constructor() {
super(...arguments);
this.title = '';
this.rows = [];
}
static fromHubtypeCMS(component, locale, cmsApi) {
const newButton = new FlowWhatsappButtonListSection(component.id);
newButton.title = this.getTextByLocale(locale, component.title);
newButton.rows = component.rows.map(row => FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi));
return newButton;
}
addSectionToBotonic(sectionIndex) {
const rows = this.rows.reduce((acc, row, rowIndex) => {
const botonicRow = row.addRowToBotonic(rowIndex, sectionIndex);
if (botonicRow) {
acc.push(botonicRow);
}
return acc;
}, []);
return { title: this.title, rows };
}
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-section.js.map