@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/{cjs/action → action}/ai-agent-from-user-input.d.ts +2 -2
- package/lib/{cjs/action → action}/ai-agent-from-user-input.js +9 -6
- package/lib/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/{esm/action → action}/context.d.ts +2 -2
- package/lib/action/context.js +20 -0
- package/lib/action/context.js.map +1 -0
- package/lib/{cjs/action → action}/fallback.d.ts +2 -2
- package/lib/{cjs/action → action}/fallback.js +16 -11
- package/lib/action/fallback.js.map +1 -0
- package/lib/action/first-interaction.d.ts +3 -0
- package/lib/{cjs/action → action}/first-interaction.js +39 -27
- package/lib/action/first-interaction.js.map +1 -0
- package/lib/{cjs/action → action}/get-contents.d.ts +1 -1
- package/lib/action/get-contents.js +56 -0
- package/lib/action/get-contents.js.map +1 -0
- package/lib/{esm/action → action}/index.d.ts +1 -1
- package/lib/{esm/action → action}/index.js +68 -32
- package/lib/action/index.js.map +1 -0
- package/lib/action/payload.d.ts +3 -0
- package/lib/{cjs/action → action}/payload.js +27 -23
- package/lib/action/payload.js.map +1 -0
- package/lib/{cjs/api.d.ts → api.d.ts} +2 -2
- package/lib/{esm/api.js → api.js} +55 -44
- package/lib/api.js.map +1 -0
- package/lib/constants.js +17 -0
- package/lib/constants.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/content-fields-base.d.ts +2 -2
- package/lib/content-fields/content-fields-base.js +78 -0
- package/lib/content-fields/content-fields-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +73 -0
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.js +15 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.d.ts +3 -3
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +94 -0
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.d.ts +4 -4
- package/lib/content-fields/flow-ai-agent-base.js +100 -0
- package/lib/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.js +57 -46
- package/lib/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.d.ts +4 -4
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.js +33 -22
- package/lib/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.js +23 -15
- package/lib/content-fields/flow-bot-action.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-button.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-button.js +48 -29
- package/lib/content-fields/flow-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-capture-user-input.d.ts +2 -2
- package/lib/content-fields/flow-capture-user-input.js +46 -0
- package/lib/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-carousel.d.ts +4 -4
- package/lib/content-fields/flow-carousel.js +193 -0
- package/lib/content-fields/flow-carousel.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.js +26 -22
- package/lib/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-country-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-country-conditional.js +26 -21
- package/lib/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-custom-conditional.d.ts +4 -4
- package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.js +31 -33
- package/lib/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-element.d.ts +4 -4
- package/lib/content-fields/flow-element.js +67 -0
- package/lib/content-fields/flow-element.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.js +25 -20
- package/lib/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.js +30 -19
- package/lib/content-fields/flow-handoff.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-image.d.ts +2 -2
- package/lib/content-fields/flow-image.js +42 -0
- package/lib/content-fields/flow-image.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.js +45 -40
- package/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-rating.d.ts +3 -3
- package/lib/content-fields/flow-rating.js +88 -0
- package/lib/content-fields/flow-rating.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-text.d.ts +4 -4
- package/lib/content-fields/flow-text.js +82 -0
- package/lib/content-fields/flow-text.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-video.d.ts +2 -2
- package/lib/content-fields/flow-video.js +42 -0
- package/lib/content-fields/flow-video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-webview.d.ts +2 -2
- package/lib/{cjs/content-fields → content-fields}/flow-webview.js +31 -28
- package/lib/content-fields/flow-webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +131 -0
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.d.ts +3 -4
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +51 -0
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-whatsapp-template.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.js +119 -102
- package/lib/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent-router.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/ai-agent.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/bot-action.js +4 -0
- package/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/button.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/button.js +4 -0
- package/lib/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/capture-user-input.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/carousel.js +4 -0
- package/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/channel-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/channel-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/common.js +4 -0
- package/lib/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/country-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/country-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.js +15 -15
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/custom-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/fallback.js +4 -0
- package/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/function.js +11 -0
- package/lib/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/go-to-flow.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/go-to-flow.js +4 -0
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/handoff.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/handoff.js +4 -0
- package/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/image.js +4 -0
- package/lib/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/content-fields/hubtype-fields/index.d.ts +27 -0
- package/lib/content-fields/hubtype-fields/index.js +57 -0
- package/lib/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/keyword.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/keyword.js +4 -0
- package/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.js +12 -12
- package/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/nodes.d.ts +23 -23
- package/lib/content-fields/hubtype-fields/nodes.js +4 -0
- package/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/payload.js +4 -0
- package/lib/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/smart-intent.js +4 -0
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/text.js +4 -0
- package/lib/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/url.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/url.js +4 -0
- package/lib/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/video.js +4 -0
- package/lib/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/webview.js +4 -0
- package/lib/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-template.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/content-fields/index.d.ts +25 -0
- package/lib/content-fields/index.js +73 -0
- package/lib/content-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +41 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +66 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.d.ts +3 -3
- package/lib/content-fields/whatsapp-button-list/index.js +12 -0
- package/lib/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/{cjs/filters → filters}/index.d.ts +2 -2
- package/lib/filters/index.js +16 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/{cjs/flow-factory.d.ts → flow-factory.d.ts} +3 -3
- package/lib/flow-factory.js +75 -0
- package/lib/flow-factory.js.map +1 -0
- package/lib/{esm/functions → functions}/index.d.ts +1 -1
- package/lib/{cjs/functions → functions}/index.js +25 -19
- package/lib/functions/index.js.map +1 -0
- package/lib/{cjs/index.d.ts → index.d.ts} +12 -12
- package/lib/{esm/index.js → index.js} +94 -77
- package/lib/index.js.map +1 -0
- package/lib/services/hubtype-queues-api.js +26 -0
- package/lib/services/hubtype-queues-api.js.map +1 -0
- package/lib/structured-output/flow-builder-content.js +16 -0
- package/lib/structured-output/flow-builder-content.js.map +1 -0
- package/lib/{cjs/tracking.d.ts → tracking.d.ts} +2 -2
- package/lib/{cjs/tracking.js → tracking.js} +27 -21
- package/lib/tracking.js.map +1 -0
- package/lib/{esm/types.d.ts → types.d.ts} +5 -5
- package/lib/types.js +14 -0
- package/lib/types.js.map +1 -0
- package/lib/{esm/user-input → user-input}/capture-user-input-api.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/capture-user-input-api.js +44 -33
- package/lib/user-input/capture-user-input-api.js.map +1 -0
- package/lib/{esm/user-input → user-input}/index.d.ts +2 -2
- package/lib/user-input/index.js +46 -0
- package/lib/user-input/index.js.map +1 -0
- package/lib/{esm/user-input → user-input}/keyword.d.ts +2 -2
- package/lib/{esm/user-input → user-input}/keyword.js +31 -26
- package/lib/user-input/keyword.js.map +1 -0
- package/lib/{cjs/user-input → user-input}/smart-intent.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/smart-intent.js +36 -32
- package/lib/user-input/smart-intent.js.map +1 -0
- package/lib/{cjs/utils → utils}/ai-agent.d.ts +3 -3
- package/lib/utils/ai-agent.js +33 -0
- package/lib/utils/ai-agent.js.map +1 -0
- package/lib/{cjs/utils → utils}/authentication.js +10 -7
- package/lib/utils/authentication.js.map +1 -0
- package/lib/{cjs/utils → utils}/flow-locale.js +14 -18
- package/lib/utils/flow-locale.js.map +1 -0
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.d.ts +1 -1
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.js +4 -4
- package/lib/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.d.ts +1 -2
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.js +57 -54
- package/lib/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/utils/input.js +37 -0
- package/lib/utils/input.js.map +1 -0
- package/lib/{cjs/webview → webview}/contents-context.d.ts +1 -1
- package/lib/webview/contents-context.js +14 -0
- package/lib/webview/contents-context.js.map +1 -0
- package/lib/webview/index.d.ts +3 -0
- package/lib/webview/index.js +11 -0
- package/lib/webview/index.js.map +1 -0
- package/lib/{esm/webview → webview}/types.d.ts +1 -1
- package/lib/webview/types.js +9 -0
- package/lib/webview/types.js.map +1 -0
- package/lib/{cjs/webview → webview}/use-webview-contents.d.ts +1 -1
- package/lib/webview/use-webview-contents.js +90 -0
- package/lib/webview/use-webview-contents.js.map +1 -0
- package/package.json +10 -8
- package/src/content-fields/flow-ai-agent-base.tsx +0 -11
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
- package/src/content-fields/index.ts +2 -2
- package/src/index.ts +5 -5
- package/src/types.ts +6 -6
- package/src/utils/hubtype-assistant-content.ts +0 -14
- package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/cjs/action/context.d.ts +0 -11
- package/lib/cjs/action/context.js +0 -17
- package/lib/cjs/action/context.js.map +0 -1
- package/lib/cjs/action/fallback.js.map +0 -1
- package/lib/cjs/action/first-interaction.d.ts +0 -3
- package/lib/cjs/action/first-interaction.js.map +0 -1
- package/lib/cjs/action/get-contents.js +0 -39
- package/lib/cjs/action/get-contents.js.map +0 -1
- package/lib/cjs/action/index.d.ts +0 -25
- package/lib/cjs/action/index.js +0 -90
- package/lib/cjs/action/index.js.map +0 -1
- package/lib/cjs/action/payload.d.ts +0 -3
- package/lib/cjs/action/payload.js.map +0 -1
- package/lib/cjs/api.js +0 -205
- package/lib/cjs/api.js.map +0 -1
- package/lib/cjs/constants.js +0 -19
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
- package/lib/cjs/content-fields/content-fields-base.js +0 -74
- package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/cjs/content-fields/flow-bot-action.js +0 -45
- package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
- package/lib/cjs/content-fields/flow-button.d.ts +0 -31
- package/lib/cjs/content-fields/flow-button.js +0 -86
- package/lib/cjs/content-fields/flow-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
- package/lib/cjs/content-fields/flow-carousel.js +0 -152
- package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
- package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-element.js +0 -50
- package/lib/cjs/content-fields/flow-element.js.map +0 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
- package/lib/cjs/content-fields/flow-image.js +0 -33
- package/lib/cjs/content-fields/flow-image.js.map +0 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
- package/lib/cjs/content-fields/flow-rating.js +0 -66
- package/lib/cjs/content-fields/flow-rating.js.map +0 -1
- package/lib/cjs/content-fields/flow-text.js +0 -60
- package/lib/cjs/content-fields/flow-text.js.map +0 -1
- package/lib/cjs/content-fields/flow-video.d.ts +0 -10
- package/lib/cjs/content-fields/flow-video.js +0 -33
- package/lib/cjs/content-fields/flow-video.js.map +0 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
- package/lib/cjs/content-fields/flow-webview.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/index.d.ts +0 -25
- package/lib/cjs/content-fields/index.js +0 -52
- package/lib/cjs/content-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/cjs/filters/index.js +0 -17
- package/lib/cjs/filters/index.js.map +0 -1
- package/lib/cjs/flow-factory.js +0 -69
- package/lib/cjs/flow-factory.js.map +0 -1
- package/lib/cjs/functions/index.d.ts +0 -11
- package/lib/cjs/functions/index.js.map +0 -1
- package/lib/cjs/index.js +0 -178
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/services/hubtype-queues-api.js +0 -26
- package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
- package/lib/cjs/structured-output/flow-builder-content.js +0 -15
- package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
- package/lib/cjs/tracking.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -62
- package/lib/cjs/types.js +0 -14
- package/lib/cjs/types.js.map +0 -1
- package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
- package/lib/cjs/user-input/index.d.ts +0 -4
- package/lib/cjs/user-input/index.js +0 -37
- package/lib/cjs/user-input/index.js.map +0 -1
- package/lib/cjs/user-input/keyword.d.ts +0 -27
- package/lib/cjs/user-input/keyword.js +0 -84
- package/lib/cjs/user-input/keyword.js.map +0 -1
- package/lib/cjs/user-input/smart-intent.js.map +0 -1
- package/lib/cjs/utils/ai-agent.js +0 -28
- package/lib/cjs/utils/ai-agent.js.map +0 -1
- package/lib/cjs/utils/authentication.js.map +0 -1
- package/lib/cjs/utils/flow-locale.js.map +0 -1
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/cjs/utils/input.js +0 -35
- package/lib/cjs/utils/input.js.map +0 -1
- package/lib/cjs/webview/contents-context.js +0 -12
- package/lib/cjs/webview/contents-context.js.map +0 -1
- package/lib/cjs/webview/index.d.ts +0 -3
- package/lib/cjs/webview/index.js +0 -10
- package/lib/cjs/webview/index.js.map +0 -1
- package/lib/cjs/webview/types.d.ts +0 -47
- package/lib/cjs/webview/types.js +0 -9
- package/lib/cjs/webview/types.js.map +0 -1
- package/lib/cjs/webview/use-webview-contents.js +0 -83
- package/lib/cjs/webview/use-webview-contents.js.map +0 -1
- package/lib/esm/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/esm/action/ai-agent-from-user-input.js +0 -32
- package/lib/esm/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/esm/action/context.js +0 -17
- package/lib/esm/action/context.js.map +0 -1
- package/lib/esm/action/fallback.d.ts +0 -3
- package/lib/esm/action/fallback.js +0 -36
- package/lib/esm/action/fallback.js.map +0 -1
- package/lib/esm/action/first-interaction.d.ts +0 -3
- package/lib/esm/action/first-interaction.js +0 -88
- package/lib/esm/action/first-interaction.js.map +0 -1
- package/lib/esm/action/get-contents.d.ts +0 -3
- package/lib/esm/action/get-contents.js +0 -39
- package/lib/esm/action/get-contents.js.map +0 -1
- package/lib/esm/action/index.js.map +0 -1
- package/lib/esm/action/payload.d.ts +0 -3
- package/lib/esm/action/payload.js +0 -74
- package/lib/esm/action/payload.js.map +0 -1
- package/lib/esm/api.d.ts +0 -40
- package/lib/esm/api.js.map +0 -1
- package/lib/esm/constants.d.ts +0 -13
- package/lib/esm/constants.js +0 -19
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/content-fields/content-fields-base.js +0 -74
- package/lib/esm/content-fields/content-fields-base.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/esm/content-fields/flow-ai-agent.js +0 -64
- package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
- package/lib/esm/content-fields/flow-button.js.map +0 -1
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/esm/content-fields/flow-capture-user-input.js +0 -45
- package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/flow-carousel.js +0 -152
- package/lib/esm/content-fields/flow-carousel.js.map +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/esm/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-element.d.ts +0 -22
- package/lib/esm/content-fields/flow-element.js +0 -50
- package/lib/esm/content-fields/flow-element.js.map +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +0 -17
- package/lib/esm/content-fields/flow-handoff.js +0 -68
- package/lib/esm/content-fields/flow-handoff.js.map +0 -1
- package/lib/esm/content-fields/flow-image.d.ts +0 -10
- package/lib/esm/content-fields/flow-image.js +0 -33
- package/lib/esm/content-fields/flow-image.js.map +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/esm/content-fields/flow-queue-status-conditional.js +0 -95
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-rating.js +0 -66
- package/lib/esm/content-fields/flow-rating.js.map +0 -1
- package/lib/esm/content-fields/flow-text.d.ts +0 -15
- package/lib/esm/content-fields/flow-text.js +0 -60
- package/lib/esm/content-fields/flow-text.js.map +0 -1
- package/lib/esm/content-fields/flow-video.js +0 -33
- package/lib/esm/content-fields/flow-video.js.map +0 -1
- package/lib/esm/content-fields/flow-webview.js +0 -78
- package/lib/esm/content-fields/flow-webview.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/common.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/function.js +0 -11
- package/lib/esm/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/esm/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/image.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/esm/content-fields/hubtype-fields/index.js +0 -31
- package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/esm/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/esm/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/text.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/url.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/video.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/index.d.ts +0 -25
- package/lib/esm/content-fields/index.js +0 -52
- package/lib/esm/content-fields/index.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/esm/filters/index.d.ts +0 -12
- package/lib/esm/filters/index.js +0 -17
- package/lib/esm/filters/index.js.map +0 -1
- package/lib/esm/flow-factory.d.ts +0 -12
- package/lib/esm/flow-factory.js +0 -69
- package/lib/esm/flow-factory.js.map +0 -1
- package/lib/esm/functions/index.js +0 -49
- package/lib/esm/functions/index.js.map +0 -1
- package/lib/esm/index.d.ts +0 -45
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/services/hubtype-queues-api.d.ts +0 -14
- package/lib/esm/services/hubtype-queues-api.js +0 -26
- package/lib/esm/services/hubtype-queues-api.js.map +0 -1
- package/lib/esm/structured-output/flow-builder-content.d.ts +0 -13
- package/lib/esm/structured-output/flow-builder-content.js +0 -15
- package/lib/esm/structured-output/flow-builder-content.js.map +0 -1
- package/lib/esm/tracking.d.ts +0 -16
- package/lib/esm/tracking.js +0 -71
- package/lib/esm/tracking.js.map +0 -1
- package/lib/esm/types.js +0 -14
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/user-input/capture-user-input-api.js +0 -88
- package/lib/esm/user-input/capture-user-input-api.js.map +0 -1
- package/lib/esm/user-input/index.js +0 -37
- package/lib/esm/user-input/index.js.map +0 -1
- package/lib/esm/user-input/keyword.js.map +0 -1
- package/lib/esm/user-input/smart-intent.d.ts +0 -24
- package/lib/esm/user-input/smart-intent.js +0 -89
- package/lib/esm/user-input/smart-intent.js.map +0 -1
- package/lib/esm/utils/ai-agent.d.ts +0 -11
- package/lib/esm/utils/ai-agent.js +0 -28
- package/lib/esm/utils/ai-agent.js.map +0 -1
- package/lib/esm/utils/authentication.d.ts +0 -2
- package/lib/esm/utils/authentication.js +0 -21
- package/lib/esm/utils/authentication.js.map +0 -1
- package/lib/esm/utils/flow-locale.d.ts +0 -22
- package/lib/esm/utils/flow-locale.js +0 -79
- package/lib/esm/utils/flow-locale.js.map +0 -1
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/esm/utils/get-flow-builder-plugin.js +0 -16
- package/lib/esm/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/esm/utils/hubtype-assistant-content.d.ts +0 -13
- package/lib/esm/utils/hubtype-assistant-content.js +0 -184
- package/lib/esm/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/esm/utils/input.d.ts +0 -6
- package/lib/esm/utils/input.js +0 -35
- package/lib/esm/utils/input.js.map +0 -1
- package/lib/esm/webview/contents-context.d.ts +0 -2
- package/lib/esm/webview/contents-context.js +0 -12
- package/lib/esm/webview/contents-context.js.map +0 -1
- package/lib/esm/webview/index.d.ts +0 -3
- package/lib/esm/webview/index.js +0 -10
- package/lib/esm/webview/index.js.map +0 -1
- package/lib/esm/webview/types.js +0 -9
- package/lib/esm/webview/types.js.map +0 -1
- package/lib/esm/webview/use-webview-contents.d.ts +0 -2
- package/lib/esm/webview/use-webview-contents.js +0 -83
- package/lib/esm/webview/use-webview-contents.js.map +0 -1
- /package/lib/{cjs/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.d.ts +0 -0
- /package/lib/{cjs/services → services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{cjs/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/authentication.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/flow-locale.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/input.d.ts +0 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HandOffBuilder, HelpdeskEvent, isDev, isWebchat } from "@botonic/core";
|
|
3
|
+
import { WebchatSettings } from "@botonic/react";
|
|
4
|
+
import { getCommonFlowContentEventArgsForContentId } from "../tracking.js";
|
|
5
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class FlowHandoff extends ContentFieldsBase {
|
|
10
18
|
static fromHubtypeCMS(cmsHandoff, locale, cmsApi) {
|
|
11
19
|
const newHandoff = new FlowHandoff(cmsHandoff.id);
|
|
12
20
|
newHandoff.code = cmsHandoff.code;
|
|
13
21
|
newHandoff.queue = FlowHandoff.getQueueByLocale(locale, cmsHandoff.content.queue);
|
|
14
22
|
newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(cmsHandoff, cmsApi);
|
|
15
23
|
newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign;
|
|
16
|
-
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
17
|
-
cmsHandoff.content.has_queue_position_changed_notifications_enabled;
|
|
24
|
+
newHandoff.hasQueuePositionChangedNotificationsEnabled = cmsHandoff.content.has_queue_position_changed_notifications_enabled;
|
|
18
25
|
newHandoff.followUp = cmsHandoff.follow_up;
|
|
19
26
|
return newHandoff;
|
|
20
27
|
}
|
|
@@ -25,11 +32,11 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
25
32
|
return undefined;
|
|
26
33
|
}
|
|
27
34
|
async doHandoff(botContext) {
|
|
28
|
-
const handOffBuilder = new
|
|
35
|
+
const handOffBuilder = new HandOffBuilder(botContext.session);
|
|
29
36
|
handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign);
|
|
30
37
|
if (this.hasQueuePositionChangedNotificationsEnabled) {
|
|
31
38
|
handOffBuilder.withSubscribeHelpdeskEvents([
|
|
32
|
-
|
|
39
|
+
HelpdeskEvent.QueuePositionChanged
|
|
33
40
|
]);
|
|
34
41
|
}
|
|
35
42
|
if (this.onFinishPayload) {
|
|
@@ -38,22 +45,22 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
38
45
|
if (this.queue) {
|
|
39
46
|
const language = botContext.getSystemLocale();
|
|
40
47
|
handOffBuilder.withQueue(this.queue.id);
|
|
41
|
-
const { flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
48
|
+
const { flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
42
49
|
handOffBuilder.withBotEvent({
|
|
43
50
|
flowId,
|
|
44
51
|
flowName,
|
|
45
52
|
flowNodeId,
|
|
46
|
-
flowNodeContentId
|
|
53
|
+
flowNodeContentId
|
|
47
54
|
});
|
|
48
55
|
handOffBuilder.withExtraData({
|
|
49
|
-
language
|
|
56
|
+
language
|
|
50
57
|
});
|
|
51
58
|
await handOffBuilder.handOff();
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
62
|
async trackFlow(_botContext) {
|
|
56
|
-
|
|
63
|
+
// TODO: Not apply for this content because backend track handoff success event
|
|
57
64
|
}
|
|
58
65
|
async processContent(botContext) {
|
|
59
66
|
await this.filterContent(botContext, this);
|
|
@@ -61,8 +68,12 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
61
68
|
return;
|
|
62
69
|
}
|
|
63
70
|
toBotonic(botContext) {
|
|
64
|
-
return
|
|
71
|
+
return isDev(botContext.session) || isWebchat(botContext.session) ? /*#__PURE__*/ jsx(WebchatSettings, {
|
|
72
|
+
enableUserInput: true
|
|
73
|
+
}, this.id) : /*#__PURE__*/ jsx(Fragment, {});
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
|
-
|
|
76
|
+
|
|
77
|
+
export { FlowHandoff };
|
|
78
|
+
|
|
68
79
|
//# sourceMappingURL=flow-handoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-handoff.js","sources":["../../src/content-fields/flow-handoff.tsx"],"sourcesContent":["import {\n type BotContext,\n HandOffBuilder,\n HelpdeskEvent,\n isDev,\n isWebchat,\n} from '@botonic/core'\nimport { WebchatSettings } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { getCommonFlowContentEventArgsForContentId } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtHandoffNode, HtQueueLocale } from './hubtype-fields'\n\nexport class FlowHandoff extends ContentFieldsBase {\n public queue?: HtQueueLocale\n public onFinishPayload?: string\n public handoffAutoAssign: boolean\n public hasQueuePositionChangedNotificationsEnabled: boolean\n public isTestIntegration: boolean\n\n static fromHubtypeCMS(\n cmsHandoff: HtHandoffNode,\n locale: string,\n cmsApi: FlowBuilderApi\n ): FlowHandoff {\n const newHandoff = new FlowHandoff(cmsHandoff.id)\n newHandoff.code = cmsHandoff.code\n newHandoff.queue = FlowHandoff.getQueueByLocale(\n locale,\n cmsHandoff.content.queue\n )\n newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(\n cmsHandoff,\n cmsApi\n )\n newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign\n newHandoff.hasQueuePositionChangedNotificationsEnabled =\n cmsHandoff.content.has_queue_position_changed_notifications_enabled\n newHandoff.followUp = cmsHandoff.follow_up\n\n return newHandoff\n }\n\n private static getOnFinishPayload(\n cmsHandoff: HtHandoffNode,\n cmsApi: FlowBuilderApi\n ): string | undefined {\n if (cmsHandoff.target?.id) {\n return cmsApi.getPayload(cmsHandoff.target)\n }\n\n return undefined\n }\n\n async doHandoff(botContext: BotContext): Promise<void> {\n const handOffBuilder = new HandOffBuilder(botContext.session)\n handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign)\n\n if (this.hasQueuePositionChangedNotificationsEnabled) {\n handOffBuilder.withSubscribeHelpdeskEvents([\n HelpdeskEvent.QueuePositionChanged,\n ])\n }\n\n if (this.onFinishPayload) {\n handOffBuilder.withOnFinishPayload(this.onFinishPayload)\n }\n\n if (this.queue) {\n const language = botContext.getSystemLocale()\n\n handOffBuilder.withQueue(this.queue.id)\n\n const { flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n handOffBuilder.withBotEvent({\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n })\n\n handOffBuilder.withExtraData({\n language,\n })\n\n await handOffBuilder.handOff()\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async trackFlow(_botContext: BotContext): Promise<void> {\n // TODO: Not apply for this content because backend track handoff success event\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.doHandoff(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n return isDev(botContext.session) || isWebchat(botContext.session) ? (\n <WebchatSettings key={this.id} enableUserInput={true} />\n ) : (\n <></>\n )\n }\n}\n"],"names":["HandOffBuilder","HelpdeskEvent","isDev","isWebchat","WebchatSettings","getCommonFlowContentEventArgsForContentId","ContentFieldsBase","FlowHandoff","cmsHandoff","locale","cmsApi","newHandoff","undefined","botContext","handOffBuilder","language","flowId","flowName","flowNodeId","flowNodeContentId","_botContext"],"mappings":";;;;;;;;;;;;AAMsB;AAC0B;AAGuB;AACd;AAGlD,MAAMO,WAAWA,SAASD,iBAAiBA;IAOhD,OAAO,eACLE,UAAyB,EACzBC,MAAc,EACdC,MAAsB,EACT;QACb,MAAMC,aAAa,IAAIJ,WAAWA,CAACC,WAAW,EAAE;QAChDG,WAAW,IAAI,GAAGH,WAAW,IAAI;QACjCG,WAAW,KAAK,GAAGJ,WAAWA,CAAC,gBAAgB,CAC7CE,QACAD,WAAW,OAAO,CAAC,KAAK;QAE1BG,WAAW,eAAe,GAAGJ,WAAWA,CAAC,kBAAkB,CACzDC,YACAE;QAEFC,WAAW,iBAAiB,GAAGH,WAAW,OAAO,CAAC,eAAe;QACjEG,WAAW,2CAA2C,GACpDH,WAAW,OAAO,CAAC,gDAAgD;QACrEG,WAAW,QAAQ,GAAGH,WAAW,SAAS;QAE1C,OAAOG;IACT;IAEA,OAAe,mBACbH,UAAyB,EACzBE,MAAsB,EACF;QACpB,IAAIF,WAAW,MAAM,EAAE,IAAI;YACzB,OAAOE,OAAO,UAAU,CAACF,WAAW,MAAM;QAC5C;QAEA,OAAOI;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMC,iBAAiB,IAAId,cAAcA,CAACa,WAAW,OAAO;QAC5DC,eAAe,uBAAuB,CAAC,IAAI,CAAC,iBAAiB;QAE7D,IAAI,IAAI,CAAC,2CAA2C,EAAE;YACpDA,eAAe,2BAA2B,CAAC;gBACzCb,kCAAkC;aACnC;QACH;QAEA,IAAI,IAAI,CAAC,eAAe,EAAE;YACxBa,eAAe,mBAAmB,CAAC,IAAI,CAAC,eAAe;QACzD;QAEA,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAMC,WAAWF,WAAW,eAAe;YAE3CC,eAAe,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAEtC,MAAM,EAAEE,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACvDd,yCAAyCA,CAACQ,YAAY,IAAI,CAAC,EAAE;YAE/DC,eAAe,YAAY,CAAC;gBAC1BE;gBACAC;gBACAC;gBACAC;YACF;YAEAL,eAAe,aAAa,CAAC;gBAC3BC;YACF;YAEA,MAAMD,eAAe,OAAO;QAC9B;IACF;IAEA,6DAA6D;IAC7D,MAAM,UAAUM,WAAuB,EAAiB;IACtD,+EAA+E;IACjF;IAEA,MAAM,eAAeP,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,OAAOX,KAAKA,CAACW,WAAW,OAAO,KAAKV,SAASA,CAACU,WAAW,OAAO,kBAC9D,IAACT,eAAeA;YAAe,iBAAiB;WAA1B,IAAI,CAAC,EAAE,kBAE7B;IAEJ;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import type { HtImageNode } from './hubtype-fields';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import type { HtImageNode } from './hubtype-fields/index.js';
|
|
4
4
|
export declare class FlowImage extends ContentFieldsBase {
|
|
5
5
|
src: string;
|
|
6
6
|
static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image } from "@botonic/react";
|
|
3
|
+
import { trackOneContent } from "../tracking.js";
|
|
4
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FlowImage extends ContentFieldsBase {
|
|
15
|
+
static fromHubtypeCMS(component, locale) {
|
|
16
|
+
const newImage = new FlowImage(component.id);
|
|
17
|
+
newImage.code = component.code;
|
|
18
|
+
newImage.src = FlowImage.getAssetByLocale(locale, component.content.image);
|
|
19
|
+
newImage.followUp = component.follow_up;
|
|
20
|
+
return newImage;
|
|
21
|
+
}
|
|
22
|
+
async trackFlow(botContext) {
|
|
23
|
+
await trackOneContent(botContext, this);
|
|
24
|
+
}
|
|
25
|
+
async processContent(botContext) {
|
|
26
|
+
await this.filterContent(botContext, this);
|
|
27
|
+
await this.trackFlow(botContext);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
toBotonic() {
|
|
31
|
+
return /*#__PURE__*/ jsx(Image, {
|
|
32
|
+
src: this.src
|
|
33
|
+
}, this.id);
|
|
34
|
+
}
|
|
35
|
+
constructor(...args){
|
|
36
|
+
super(...args), this.src = '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { FlowImage };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=flow-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-image.js","sources":["../../src/content-fields/flow-image.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Image } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtImageNode } from './hubtype-fields'\n\nexport class FlowImage extends ContentFieldsBase {\n public src = ''\n\n static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage {\n const newImage = new FlowImage(component.id)\n newImage.code = component.code\n newImage.src = FlowImage.getAssetByLocale(locale, component.content.image)\n newImage.followUp = component.follow_up\n\n return newImage\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <Image key={this.id} src={this.src} />\n }\n}\n"],"names":["Image","trackOneContent","ContentFieldsBase","FlowImage","component","locale","newImage","botContext"],"mappings":";;;;;;;;;;AACsC;AAEO;AACY;AAGlD,MAAMG,SAASA,SAASD,iBAAiBA;IAG9C,OAAO,eAAeE,SAAsB,EAAEC,MAAc,EAAa;QACvE,MAAMC,WAAW,IAAIH,SAASA,CAACC,UAAU,EAAE;QAC3CE,SAAS,IAAI,GAAGF,UAAU,IAAI;QAC9BE,SAAS,GAAG,GAAGH,SAASA,CAAC,gBAAgB,CAACE,QAAQD,UAAU,OAAO,CAAC,KAAK;QACzEE,SAAS,QAAQ,GAAGF,UAAU,SAAS;QAEvC,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMN,eAAeA,CAACM,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO,IAACP,KAAKA;YAAe,KAAK,IAAI,CAAC,GAAG;WAAtB,IAAI,CAAC,EAAE;IAC5B;;QAxBK,qBACE,MAAM;;AAwBf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import type { HtFunctionArguments, HtFunctionResult } from './hubtype-fields/function';
|
|
4
|
-
import type { HtQueueStatusConditionalNode, HtQueueStatusConditionalResultMapping } from './hubtype-fields/queue-status-conditional';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import type { HtFunctionArguments, HtFunctionResult } from './hubtype-fields/function.js';
|
|
4
|
+
import type { HtQueueStatusConditionalNode, HtQueueStatusConditionalResultMapping } from './hubtype-fields/queue-status-conditional.js';
|
|
5
5
|
declare enum QueueStatusResult {
|
|
6
6
|
OPEN = "open",
|
|
7
7
|
CLOSED = "closed",
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EventAction } from "@botonic/core";
|
|
3
|
+
import { getArgumentsByLocale } from "../functions/index.js";
|
|
4
|
+
import { HubtypeQueuesApi } from "../services/hubtype-queues-api.js";
|
|
5
|
+
import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
|
|
6
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var flow_queue_status_conditional_QueueStatusResult = /*#__PURE__*/ (/* unused pure expression or super */ null && (function(QueueStatusResult) {
|
|
12
21
|
QueueStatusResult["OPEN"] = "open";
|
|
13
22
|
QueueStatusResult["CLOSED"] = "closed";
|
|
14
23
|
QueueStatusResult["OPEN_WITHOUT_AGENTS"] = "open-without-agents";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.arguments = [];
|
|
20
|
-
this.queueId = '';
|
|
21
|
-
this.queueName = '';
|
|
22
|
-
this.isQueueOpen = false;
|
|
23
|
-
this.isAvailableAgent = false;
|
|
24
|
-
}
|
|
24
|
+
return QueueStatusResult;
|
|
25
|
+
}(flow_queue_status_conditional_QueueStatusResult || {})));
|
|
26
|
+
class FlowQueueStatusConditional extends ContentFieldsBase {
|
|
25
27
|
static async fromHubtypeCMS(component, locale) {
|
|
26
28
|
const newChannelConditional = new FlowQueueStatusConditional(component.id);
|
|
27
29
|
newChannelConditional.code = component.code;
|
|
28
30
|
newChannelConditional.arguments = component.content.arguments;
|
|
29
|
-
newChannelConditional.resultMapping = component.content
|
|
30
|
-
.result_mapping;
|
|
31
|
+
newChannelConditional.resultMapping = component.content.result_mapping;
|
|
31
32
|
await newChannelConditional.setConditionalResult(locale);
|
|
32
33
|
return newChannelConditional;
|
|
33
34
|
}
|
|
34
35
|
async setConditionalResult(locale) {
|
|
35
|
-
const args =
|
|
36
|
-
const queueId = args.find(arg
|
|
37
|
-
const queueName = args.find(arg
|
|
38
|
-
const checkAvailableAgents = args.find(arg
|
|
39
|
-
?.value || false;
|
|
36
|
+
const args = getArgumentsByLocale(this.arguments, locale);
|
|
37
|
+
const queueId = args.find((arg)=>arg.name === 'queue_id')?.value || '';
|
|
38
|
+
const queueName = args.find((arg)=>arg.name === 'queue_name')?.value || '';
|
|
39
|
+
const checkAvailableAgents = args.find((arg)=>arg.name === 'check_available_agents')?.value || false;
|
|
40
40
|
const queueStatus = await this.conditionalQueueStatus({
|
|
41
41
|
queueId,
|
|
42
42
|
queueName,
|
|
43
|
-
checkAvailableAgents
|
|
43
|
+
checkAvailableAgents
|
|
44
44
|
});
|
|
45
|
-
const conditionalResult = this.resultMapping.find(rMap
|
|
45
|
+
const conditionalResult = this.resultMapping.find((rMap)=>rMap.result === queueStatus);
|
|
46
46
|
if (!conditionalResult) {
|
|
47
47
|
throw new Error(`No conditional result found for node ${this.code} with queue: ${queueName}`);
|
|
48
48
|
}
|
|
49
49
|
this.conditionalResult = conditionalResult;
|
|
50
50
|
this.followUp = conditionalResult.target;
|
|
51
51
|
}
|
|
52
|
-
async conditionalQueueStatus({ queueId, checkAvailableAgents, queueName
|
|
53
|
-
const queuesApi = new
|
|
52
|
+
async conditionalQueueStatus({ queueId, checkAvailableAgents, queueName }) {
|
|
53
|
+
const queuesApi = new HubtypeQueuesApi(queueId, checkAvailableAgents);
|
|
54
54
|
const data = await queuesApi.getAvailability();
|
|
55
55
|
this.queueId = queueId;
|
|
56
56
|
this.queueName = queueName;
|
|
57
57
|
this.isQueueOpen = data.open;
|
|
58
58
|
this.isAvailableAgent = data.available_agents > 0;
|
|
59
59
|
if (checkAvailableAgents && data.open && data.available_agents === 0) {
|
|
60
|
-
return
|
|
60
|
+
return "open-without-agents";
|
|
61
61
|
}
|
|
62
|
-
return data.open ?
|
|
62
|
+
return data.open ? "open" : "closed";
|
|
63
63
|
}
|
|
64
64
|
async trackFlow(botContext) {
|
|
65
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
65
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
66
66
|
if (!this.conditionalResult?.result) {
|
|
67
67
|
console.warn(`Tracking event for node ${this.code} but no conditional result found`);
|
|
68
68
|
}
|
|
69
69
|
const eventQueueStatusConditional = {
|
|
70
|
-
action:
|
|
70
|
+
action: EventAction.ConditionalQueueStatus,
|
|
71
71
|
flowThreadId,
|
|
72
72
|
flowId,
|
|
73
73
|
flowName,
|
|
@@ -77,10 +77,10 @@ class FlowQueueStatusConditional extends content_fields_base_1.ContentFieldsBase
|
|
|
77
77
|
queueId: this.queueId,
|
|
78
78
|
queueName: this.queueName,
|
|
79
79
|
isQueueOpen: this.isQueueOpen,
|
|
80
|
-
isAvailableAgent: this.isAvailableAgent
|
|
80
|
+
isAvailableAgent: this.isAvailableAgent
|
|
81
81
|
};
|
|
82
82
|
const { action, ...eventArgs } = eventQueueStatusConditional;
|
|
83
|
-
await
|
|
83
|
+
await trackEvent(botContext, action, eventArgs);
|
|
84
84
|
}
|
|
85
85
|
async processContent(botContext) {
|
|
86
86
|
await this.filterContent(botContext, this);
|
|
@@ -88,8 +88,13 @@ class FlowQueueStatusConditional extends content_fields_base_1.ContentFieldsBase
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
toBotonic() {
|
|
91
|
-
return
|
|
91
|
+
return /*#__PURE__*/ jsx(Fragment, {});
|
|
92
|
+
}
|
|
93
|
+
constructor(...args){
|
|
94
|
+
super(...args), this.arguments = [], this.queueId = '', this.queueName = '', this.isQueueOpen = false, this.isAvailableAgent = false;
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
|
|
98
|
+
export { FlowQueueStatusConditional };
|
|
99
|
+
|
|
95
100
|
//# sourceMappingURL=flow-queue-status-conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-queue-status-conditional.js","sources":["../../src/content-fields/flow-queue-status-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalQueueStatus,\n} from '@botonic/core'\n\nimport { getArgumentsByLocale } from '../functions'\nimport { HubtypeQueuesApi } from '../services/hubtype-queues-api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type {\n HtFunctionArguments,\n HtFunctionResult,\n} from './hubtype-fields/function'\nimport type {\n HtQueueStatusConditionalNode,\n HtQueueStatusConditionalResultMapping,\n} from './hubtype-fields/queue-status-conditional'\n\nenum QueueStatusResult {\n OPEN = 'open',\n CLOSED = 'closed',\n OPEN_WITHOUT_AGENTS = 'open-without-agents',\n}\n\ntype ConditionalQueueStatusArgs = {\n queueId: string\n queueName: string\n checkAvailableAgents: boolean\n}\n\nexport class FlowQueueStatusConditional extends ContentFieldsBase {\n public arguments: HtFunctionArguments[] = []\n public resultMapping: HtQueueStatusConditionalResultMapping\n public conditionalResult?: HtFunctionResult\n public queueId: string = ''\n public queueName: string = ''\n public isQueueOpen: boolean = false\n public isAvailableAgent: boolean = false\n\n static async fromHubtypeCMS(\n component: HtQueueStatusConditionalNode,\n locale: string\n ): Promise<FlowQueueStatusConditional> {\n const newChannelConditional = new FlowQueueStatusConditional(component.id)\n newChannelConditional.code = component.code\n newChannelConditional.arguments = component.content.arguments\n newChannelConditional.resultMapping = component.content\n .result_mapping as HtQueueStatusConditionalResultMapping\n await newChannelConditional.setConditionalResult(locale)\n\n return newChannelConditional\n }\n\n async setConditionalResult(locale: string): Promise<void> {\n const args = getArgumentsByLocale(this.arguments, locale)\n\n const queueId = args.find(arg => arg.name === 'queue_id')?.value || ''\n const queueName = args.find(arg => arg.name === 'queue_name')?.value || ''\n const checkAvailableAgents =\n (args.find(arg => arg.name === 'check_available_agents')\n ?.value as unknown as boolean) || false\n\n const queueStatus = await this.conditionalQueueStatus({\n queueId,\n queueName,\n checkAvailableAgents,\n })\n\n const conditionalResult = this.resultMapping.find(\n rMap => rMap.result === queueStatus\n )\n\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with queue: ${queueName}`\n )\n }\n this.conditionalResult = conditionalResult\n this.followUp = conditionalResult.target\n }\n\n async conditionalQueueStatus({\n queueId,\n checkAvailableAgents,\n queueName,\n }: ConditionalQueueStatusArgs): Promise<QueueStatusResult> {\n const queuesApi = new HubtypeQueuesApi(queueId, checkAvailableAgents)\n const data = await queuesApi.getAvailability()\n this.queueId = queueId\n this.queueName = queueName\n this.isQueueOpen = data.open\n this.isAvailableAgent = data.available_agents > 0\n\n if (checkAvailableAgents && data.open && data.available_agents === 0) {\n return QueueStatusResult.OPEN_WITHOUT_AGENTS\n }\n\n return data.open ? QueueStatusResult.OPEN : QueueStatusResult.CLOSED\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n if (!this.conditionalResult?.result) {\n console.warn(\n `Tracking event for node ${this.code} but no conditional result found`\n )\n }\n const eventQueueStatusConditional: EventConditionalQueueStatus = {\n action: EventAction.ConditionalQueueStatus,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n queueId: this.queueId,\n queueName: this.queueName,\n isQueueOpen: this.isQueueOpen,\n isAvailableAgent: this.isAvailableAgent,\n }\n const { action, ...eventArgs } = eventQueueStatusConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getArgumentsByLocale","HubtypeQueuesApi","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","QueueStatusResult","FlowQueueStatusConditional","component","locale","newChannelConditional","args","queueId","arg","queueName","checkAvailableAgents","queueStatus","conditionalResult","rMap","Error","queuesApi","data","botContext","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","console","eventQueueStatusConditional","action","eventArgs"],"mappings":";;;;;;;;;;;;;;AAIsB;AAE6B;AACc;AAI7C;AACqC;AAUzD,IAAKM,+CAAiBA,iBAAjBA,gDAAAA,SAAAA;;;;WAAAA;EAAAA,+CAAiBA,OAAjBA,EAAAA;AAYE,MAAMC,0BAA0BA,SAASF,iBAAiBA;IAS/D,aAAa,eACXG,SAAuC,EACvCC,MAAc,EACuB;QACrC,MAAMC,wBAAwB,IAAIH,0BAA0BA,CAACC,UAAU,EAAE;QACzEE,sBAAsB,IAAI,GAAGF,UAAU,IAAI;QAC3CE,sBAAsB,SAAS,GAAGF,UAAU,OAAO,CAAC,SAAS;QAC7DE,sBAAsB,aAAa,GAAGF,UAAU,OAAO,CACpD,cAAc;QACjB,MAAME,sBAAsB,oBAAoB,CAACD;QAEjD,OAAOC;IACT;IAEA,MAAM,qBAAqBD,MAAc,EAAiB;QACxD,MAAME,OAAOV,oBAAoBA,CAAC,IAAI,CAAC,SAAS,EAAEQ;QAElD,MAAMG,UAAUD,KAAK,IAAI,CAACE,CAAAA,MAAOA,IAAI,IAAI,KAAK,aAAa,SAAS;QACpE,MAAMC,YAAYH,KAAK,IAAI,CAACE,CAAAA,MAAOA,IAAI,IAAI,KAAK,eAAe,SAAS;QACxE,MAAME,uBACHJ,KAAK,IAAI,CAACE,CAAAA,MAAOA,IAAI,IAAI,KAAK,2BAC3B,SAAgC;QAEtC,MAAMG,cAAc,MAAM,IAAI,CAAC,sBAAsB,CAAC;YACpDJ;YACAE;YACAC;QACF;QAEA,MAAME,oBAAoB,IAAI,CAAC,aAAa,CAAC,IAAI,CAC/CC,CAAAA,OAAQA,KAAK,MAAM,KAAKF;QAG1B,IAAI,CAACC,mBAAmB;YACtB,MAAM,IAAIE,MACR,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAEL,WAAW;QAEhF;QACA,IAAI,CAAC,iBAAiB,GAAGG;QACzB,IAAI,CAAC,QAAQ,GAAGA,kBAAkB,MAAM;IAC1C;IAEA,MAAM,uBAAuB,EAC3BL,OAAO,EACPG,oBAAoB,EACpBD,SAAS,EACkB,EAA8B;QACzD,MAAMM,YAAY,IAAIlB,gBAAgBA,CAACU,SAASG;QAChD,MAAMM,OAAO,MAAMD,UAAU,eAAe;QAC5C,IAAI,CAAC,OAAO,GAAGR;QACf,IAAI,CAAC,SAAS,GAAGE;QACjB,IAAI,CAAC,WAAW,GAAGO,KAAK,IAAI;QAC5B,IAAI,CAAC,gBAAgB,GAAGA,KAAK,gBAAgB,GAAG;QAEhD,IAAIN,wBAAwBM,KAAK,IAAI,IAAIA,KAAK,gBAAgB,KAAK,GAAG;YACpE;QACF;QAEA,OAAOA,KAAK,IAAI;IAClB;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrExB,yCAAyCA,CAACmB,YAAY,IAAI,CAAC,EAAE;QAC/D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ;YACnCM,QAAQ,IAAI,CACV,CAAC,wBAAwB,EAAE,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC;QAE1E;QACA,MAAMC,8BAA2D;YAC/D,QAAQ7B,kCAAkC;YAC1CuB;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,OAAO;YACrB,WAAW,IAAI,CAAC,SAAS;YACzB,aAAa,IAAI,CAAC,WAAW;YAC7B,kBAAkB,IAAI,CAAC,gBAAgB;QACzC;QACA,MAAM,EAAEG,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMzB,UAAUA,CAACkB,YAAYQ,QAAQC;IACvC;IAEA,MAAM,eAAeT,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO;IACT;;QAvGK,qBACE,YAAmC,EAAE,OAGrC,UAAkB,SAClB,YAAoB,SACpB,cAAuB,YACvB,mBAA4B;;AAiGrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import { FlowButton } from './flow-button';
|
|
4
|
-
import { type HtRatingNode, RatingType } from './hubtype-fields';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import { FlowButton } from './flow-button.js';
|
|
4
|
+
import { type HtRatingNode, RatingType } from './hubtype-fields/index.js';
|
|
5
5
|
export declare class FlowRating extends ContentFieldsBase {
|
|
6
6
|
text: string;
|
|
7
7
|
sendButtonText: string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isDev, isWebchat, isWhatsapp } from "@botonic/core";
|
|
3
|
+
import { CustomRatingMessage, Text, WhatsappButtonList } from "@botonic/react";
|
|
4
|
+
import { trackOneContent } from "../tracking.js";
|
|
5
|
+
import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
|
|
6
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
7
|
+
import { FlowButton } from "./flow-button.js";
|
|
8
|
+
import { RatingType } from "./hubtype-fields/index.js";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FlowRating extends ContentFieldsBase {
|
|
27
|
+
static fromHubtypeCMS(cmsText, locale) {
|
|
28
|
+
const newRating = new FlowRating(cmsText.id);
|
|
29
|
+
newRating.code = cmsText.code;
|
|
30
|
+
newRating.text = FlowRating.getTextByLocale(locale, cmsText.content.text);
|
|
31
|
+
newRating.sendButtonText = FlowRating.getTextByLocale(locale, cmsText.content.send_button_text);
|
|
32
|
+
newRating.ratingType = cmsText.content.rating_type;
|
|
33
|
+
newRating.buttons = cmsText.content.buttons.map((button)=>FlowButton.fromRating(button));
|
|
34
|
+
newRating.openListButtonText = FlowRating.getTextByLocale(locale, cmsText.content.open_list_button_text);
|
|
35
|
+
newRating.followUp = cmsText.follow_up;
|
|
36
|
+
return newRating;
|
|
37
|
+
}
|
|
38
|
+
async trackFlow(botContext) {
|
|
39
|
+
await trackOneContent(botContext, this);
|
|
40
|
+
}
|
|
41
|
+
async processContent(botContext) {
|
|
42
|
+
await this.filterContent(botContext, this);
|
|
43
|
+
await this.trackFlow(botContext);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
toBotonic(botContext) {
|
|
47
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
|
|
48
|
+
const customRatingMessageEnabled = flowBuilderPlugin.customRatingMessageEnabled;
|
|
49
|
+
const replacedText = this.replaceVariables(this.text, botContext);
|
|
50
|
+
if (isWhatsapp(botContext.session)) {
|
|
51
|
+
return /*#__PURE__*/ jsx(WhatsappButtonList, {
|
|
52
|
+
body: replacedText,
|
|
53
|
+
button: this.openListButtonText,
|
|
54
|
+
sections: [
|
|
55
|
+
{
|
|
56
|
+
rows: this.buttons.map((button)=>({
|
|
57
|
+
id: button.payload,
|
|
58
|
+
title: button.text
|
|
59
|
+
}))
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if ((isWebchat(botContext.session) || isDev(botContext.session)) && customRatingMessageEnabled) {
|
|
65
|
+
const payloads = this.buttons.map((button)=>button.payload).slice().reverse();
|
|
66
|
+
return /*#__PURE__*/ jsx(CustomRatingMessage, {
|
|
67
|
+
alt: replacedText,
|
|
68
|
+
payloads: payloads,
|
|
69
|
+
messageText: replacedText,
|
|
70
|
+
buttonText: this.sendButtonText,
|
|
71
|
+
ratingType: this.ratingType
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return /*#__PURE__*/ jsxs(Text, {
|
|
75
|
+
children: [
|
|
76
|
+
replacedText,
|
|
77
|
+
this.buttons.map((button, buttonIndex)=>button.renderButton(buttonIndex))
|
|
78
|
+
]
|
|
79
|
+
}, this.id);
|
|
80
|
+
}
|
|
81
|
+
constructor(...args){
|
|
82
|
+
super(...args), this.text = '', this.sendButtonText = '', this.ratingType = RatingType.Stars, this.buttons = [], this.openListButtonText = '';
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { FlowRating };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=flow-rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-rating.js","sources":["../../src/content-fields/flow-rating.tsx"],"sourcesContent":["import { type BotContext, isDev, isWebchat, isWhatsapp } from '@botonic/core'\nimport { CustomRatingMessage, Text, WhatsappButtonList } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport { type HtRatingNode, RatingType } from './hubtype-fields'\n\nexport class FlowRating extends ContentFieldsBase {\n public text = ''\n public sendButtonText = ''\n public ratingType = RatingType.Stars\n public buttons: FlowButton[] = []\n public openListButtonText = ''\n\n static fromHubtypeCMS(cmsText: HtRatingNode, locale: string): FlowRating {\n const newRating = new FlowRating(cmsText.id)\n newRating.code = cmsText.code\n newRating.text = FlowRating.getTextByLocale(locale, cmsText.content.text)\n newRating.sendButtonText = FlowRating.getTextByLocale(\n locale,\n cmsText.content.send_button_text\n )\n newRating.ratingType = cmsText.content.rating_type\n newRating.buttons = cmsText.content.buttons.map(button =>\n FlowButton.fromRating(button)\n )\n newRating.openListButtonText = FlowRating.getTextByLocale(\n locale,\n cmsText.content.open_list_button_text\n )\n newRating.followUp = cmsText.follow_up\n\n return newRating\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const customRatingMessageEnabled =\n flowBuilderPlugin.customRatingMessageEnabled\n const replacedText = this.replaceVariables(this.text, botContext)\n\n if (isWhatsapp(botContext.session)) {\n return (\n <WhatsappButtonList\n body={replacedText}\n button={this.openListButtonText}\n sections={[\n {\n rows: this.buttons.map(button => ({\n id: button.payload as string,\n title: button.text,\n })),\n },\n ]}\n />\n )\n }\n\n if (\n (isWebchat(botContext.session) || isDev(botContext.session)) &&\n customRatingMessageEnabled\n ) {\n const payloads = this.buttons\n .map(button => button.payload)\n .slice()\n .reverse()\n\n return (\n <CustomRatingMessage\n alt={replacedText}\n payloads={payloads}\n messageText={replacedText}\n buttonText={this.sendButtonText}\n ratingType={this.ratingType}\n />\n )\n }\n\n return (\n <Text key={this.id}>\n {replacedText}\n {this.buttons.map((button, buttonIndex) =>\n button.renderButton(buttonIndex)\n )}\n </Text>\n )\n }\n}\n"],"names":["isDev","isWebchat","isWhatsapp","CustomRatingMessage","Text","WhatsappButtonList","trackOneContent","getFlowBuilderPlugin","ContentFieldsBase","FlowButton","RatingType","FlowRating","cmsText","locale","newRating","button","botContext","flowBuilderPlugin","customRatingMessageEnabled","replacedText","payloads","buttonIndex"],"mappings":";;;;;;;;;;;;;;;;;;AAA6E;AACC;AAEjC;AAC0B;AACd;AACf;AACsB;AAEzD,MAAMW,UAAUA,SAASH,iBAAiBA;IAO/C,OAAO,eAAeI,OAAqB,EAAEC,MAAc,EAAc;QACvE,MAAMC,YAAY,IAAIH,UAAUA,CAACC,QAAQ,EAAE;QAC3CE,UAAU,IAAI,GAAGF,QAAQ,IAAI;QAC7BE,UAAU,IAAI,GAAGH,UAAUA,CAAC,eAAe,CAACE,QAAQD,QAAQ,OAAO,CAAC,IAAI;QACxEE,UAAU,cAAc,GAAGH,UAAUA,CAAC,eAAe,CACnDE,QACAD,QAAQ,OAAO,CAAC,gBAAgB;QAElCE,UAAU,UAAU,GAAGF,QAAQ,OAAO,CAAC,WAAW;QAClDE,UAAU,OAAO,GAAGF,QAAQ,OAAO,CAAC,OAAO,CAAC,GAAG,CAACG,CAAAA,SAC9CN,qBAAqB,CAACM;QAExBD,UAAU,kBAAkB,GAAGH,UAAUA,CAAC,eAAe,CACvDE,QACAD,QAAQ,OAAO,CAAC,qBAAqB;QAEvCE,UAAU,QAAQ,GAAGF,QAAQ,SAAS;QAEtC,OAAOE;IACT;IAEA,MAAM,UAAUE,UAAsB,EAAiB;QACrD,MAAMV,eAAeA,CAACU,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,MAAMC,oBAAoBV,oBAAoBA,CAACS,WAAW,OAAO;QACjE,MAAME,6BACJD,kBAAkB,0BAA0B;QAC9C,MAAME,eAAe,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAEH;QAEtD,IAAId,UAAUA,CAACc,WAAW,OAAO,GAAG;YAClC,qBACE,IAACX,kBAAkBA;gBACjB,MAAMc;gBACN,QAAQ,IAAI,CAAC,kBAAkB;gBAC/B,UAAU;oBACR;wBACE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAACJ,CAAAA,SAAW;gCAChC,IAAIA,OAAO,OAAO;gCAClB,OAAOA,OAAO,IAAI;4BACpB;oBACF;iBACD;;QAGP;QAEA,IACGd,CAAAA,SAASA,CAACe,WAAW,OAAO,KAAKhB,KAAKA,CAACgB,WAAW,OAAO,MAC1DE,4BACA;YACA,MAAME,WAAW,IAAI,CAAC,OAAO,CAC1B,GAAG,CAACL,CAAAA,SAAUA,OAAO,OAAO,EAC5B,KAAK,GACL,OAAO;YAEV,qBACE,IAACZ,mBAAmBA;gBAClB,KAAKgB;gBACL,UAAUC;gBACV,aAAaD;gBACb,YAAY,IAAI,CAAC,cAAc;gBAC/B,YAAY,IAAI,CAAC,UAAU;;QAGjC;QAEA,qBACE,KAACf,IAAIA;;gBACFe;gBACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAACJ,QAAQM,cACzBN,OAAO,YAAY,CAACM;;WAHb,IAAI,CAAC,EAAE;IAOtB;;QAzFK,qBACE,OAAO,SACP,iBAAiB,SACjB,aAAaX,gBAAgB,OAC7B,UAAwB,EAAE,OAC1B,qBAAqB;;AAqF9B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BotContext, BotExecutorMessage, TextMessage, TextWithButtonsMessage } from '@botonic/core';
|
|
2
|
-
import type { FlowBuilderApi } from '../api';
|
|
3
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
4
|
-
import { FlowButton } from './flow-button';
|
|
5
|
-
import { HtButtonStyle, type HtTextNode } from './hubtype-fields';
|
|
2
|
+
import type { FlowBuilderApi } from '../api.js';
|
|
3
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
4
|
+
import { FlowButton } from './flow-button.js';
|
|
5
|
+
import { HtButtonStyle, type HtTextNode } from './hubtype-fields/index.js';
|
|
6
6
|
export declare class FlowText extends ContentFieldsBase {
|
|
7
7
|
text: string;
|
|
8
8
|
buttons: FlowButton[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "@botonic/react";
|
|
3
|
+
import { EMPTY_PAYLOAD, SOURCE_INFO_SEPARATOR } from "../constants.js";
|
|
4
|
+
import { trackOneContent } from "../tracking.js";
|
|
5
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
6
|
+
import { FlowButton } from "./flow-button.js";
|
|
7
|
+
import { HtButtonStyle } from "./hubtype-fields/index.js";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class FlowText extends ContentFieldsBase {
|
|
24
|
+
static fromHubtypeCMS(cmsText, locale, cmsApi, botContext) {
|
|
25
|
+
const newText = new FlowText(cmsText.id);
|
|
26
|
+
newText.code = cmsText.code;
|
|
27
|
+
newText.buttonStyle = cmsText.content.buttons_style || HtButtonStyle.BUTTON;
|
|
28
|
+
newText.text = FlowText.getTextByLocale(locale, cmsText.content.text);
|
|
29
|
+
newText.buttons = cmsText.content.buttons.map((button)=>FlowButton.fromHubtypeCMS(button, locale, cmsApi, botContext));
|
|
30
|
+
newText.followUp = cmsText.follow_up;
|
|
31
|
+
return newText;
|
|
32
|
+
}
|
|
33
|
+
async trackFlow(botContext) {
|
|
34
|
+
await trackOneContent(botContext, this);
|
|
35
|
+
for (const button of this.buttons){
|
|
36
|
+
await button.trackFlow(botContext);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static fromAIAgent(id, textMessage) {
|
|
40
|
+
if (textMessage.type === 'text') {
|
|
41
|
+
return /*#__PURE__*/ jsx(Text, {
|
|
42
|
+
children: textMessage.content.text
|
|
43
|
+
}, id);
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/ jsxs(Text, {
|
|
46
|
+
children: [
|
|
47
|
+
textMessage.content.text,
|
|
48
|
+
textMessage.content.buttons.map((button, buttonIndex)=>{
|
|
49
|
+
const buttonData = {
|
|
50
|
+
id: `${id}-button-${buttonIndex}`,
|
|
51
|
+
text: button.text,
|
|
52
|
+
url: button.url,
|
|
53
|
+
target: button.target,
|
|
54
|
+
payload: button.payload || `${EMPTY_PAYLOAD}${SOURCE_INFO_SEPARATOR}${buttonIndex}`
|
|
55
|
+
};
|
|
56
|
+
return FlowButton.fromAIAgent(buttonData).renderButton(buttonIndex);
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}, id);
|
|
60
|
+
}
|
|
61
|
+
async processContent(botContext) {
|
|
62
|
+
await this.filterContent(botContext, this);
|
|
63
|
+
await this.trackFlow(botContext);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
toBotonic(botContext) {
|
|
67
|
+
const replacedText = this.replaceVariables(this.text, botContext);
|
|
68
|
+
return /*#__PURE__*/ jsxs(Text, {
|
|
69
|
+
children: [
|
|
70
|
+
replacedText,
|
|
71
|
+
this.buttons.map((button, buttonIndex)=>button.renderButton(buttonIndex, this.buttonStyle))
|
|
72
|
+
]
|
|
73
|
+
}, this.id);
|
|
74
|
+
}
|
|
75
|
+
constructor(...args){
|
|
76
|
+
super(...args), this.text = '', this.buttons = [], this.buttonStyle = HtButtonStyle.BUTTON;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { FlowText };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=flow-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-text.js","sources":["../../src/content-fields/flow-text.tsx"],"sourcesContent":["import type {\n BotContext,\n BotExecutorMessage,\n TextMessage,\n TextWithButtonsMessage,\n} from '@botonic/core'\nimport { Text } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { EMPTY_PAYLOAD, SOURCE_INFO_SEPARATOR } from '../constants'\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport { HtButtonStyle, type HtTextNode } from './hubtype-fields'\n\nexport class FlowText extends ContentFieldsBase {\n public text = ''\n public buttons: FlowButton[] = []\n public buttonStyle = HtButtonStyle.BUTTON\n\n static fromHubtypeCMS(\n cmsText: HtTextNode,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowText {\n const newText = new FlowText(cmsText.id)\n newText.code = cmsText.code\n newText.buttonStyle = cmsText.content.buttons_style || HtButtonStyle.BUTTON\n newText.text = FlowText.getTextByLocale(locale, cmsText.content.text)\n newText.buttons = cmsText.content.buttons.map(button =>\n FlowButton.fromHubtypeCMS(button, locale, cmsApi, botContext)\n )\n newText.followUp = cmsText.follow_up\n\n return newText\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n for (const button of this.buttons) {\n await button.trackFlow(botContext)\n }\n }\n\n static fromAIAgent(\n id: string,\n textMessage: TextMessage | TextWithButtonsMessage | BotExecutorMessage\n ): JSX.Element {\n if (textMessage.type === 'text') {\n return <Text key={id}>{textMessage.content.text}</Text>\n }\n\n return (\n <Text key={id}>\n {textMessage.content.text}\n {textMessage.content.buttons.map((button, buttonIndex) => {\n const buttonData = {\n id: `${id}-button-${buttonIndex}`,\n text: button.text,\n url: button.url,\n target: button.target,\n payload:\n button.payload ||\n `${EMPTY_PAYLOAD}${SOURCE_INFO_SEPARATOR}${buttonIndex}`,\n }\n return FlowButton.fromAIAgent(buttonData).renderButton(buttonIndex)\n })}\n </Text>\n )\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const replacedText = this.replaceVariables(this.text, botContext)\n return (\n <Text key={this.id}>\n {replacedText}\n {this.buttons.map((button, buttonIndex) =>\n button.renderButton(buttonIndex, this.buttonStyle)\n )}\n </Text>\n )\n }\n}\n"],"names":["Text","EMPTY_PAYLOAD","SOURCE_INFO_SEPARATOR","trackOneContent","ContentFieldsBase","FlowButton","HtButtonStyle","FlowText","cmsText","locale","cmsApi","botContext","newText","button","id","textMessage","buttonIndex","buttonData","replacedText"],"mappings":";;;;;;;;;;;;;;;;AAMqC;AAG8B;AACtB;AACY;AACf;AACuB;AAE1D,MAAMO,QAAQA,SAASH,iBAAiBA;IAK7C,OAAO,eACLI,OAAmB,EACnBC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACZ;QACV,MAAMC,UAAU,IAAIL,QAAQA,CAACC,QAAQ,EAAE;QACvCI,QAAQ,IAAI,GAAGJ,QAAQ,IAAI;QAC3BI,QAAQ,WAAW,GAAGJ,QAAQ,OAAO,CAAC,aAAa,IAAIF,oBAAoB;QAC3EM,QAAQ,IAAI,GAAGL,QAAQA,CAAC,eAAe,CAACE,QAAQD,QAAQ,OAAO,CAAC,IAAI;QACpEI,QAAQ,OAAO,GAAGJ,QAAQ,OAAO,CAAC,OAAO,CAAC,GAAG,CAACK,CAAAA,SAC5CR,yBAAyB,CAACQ,QAAQJ,QAAQC,QAAQC;QAEpDC,QAAQ,QAAQ,GAAGJ,QAAQ,SAAS;QAEpC,OAAOI;IACT;IAEA,MAAM,UAAUD,UAAsB,EAAiB;QACrD,MAAMR,eAAeA,CAACQ,YAAY,IAAI;QACtC,KAAK,MAAME,UAAU,IAAI,CAAC,OAAO,CAAE;YACjC,MAAMA,OAAO,SAAS,CAACF;QACzB;IACF;IAEA,OAAO,YACLG,EAAU,EACVC,WAAsE,EACzD;QACb,IAAIA,YAAY,IAAI,KAAK,QAAQ;YAC/B,qBAAO,IAACf,IAAIA;0BAAWe,YAAY,OAAO,CAAC,IAAI;eAA7BD;QACpB;QAEA,qBACE,KAACd,IAAIA;;gBACFe,YAAY,OAAO,CAAC,IAAI;gBACxBA,YAAY,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAACF,QAAQG;oBACxC,MAAMC,aAAa;wBACjB,IAAI,GAAGH,GAAG,QAAQ,EAAEE,aAAa;wBACjC,MAAMH,OAAO,IAAI;wBACjB,KAAKA,OAAO,GAAG;wBACf,QAAQA,OAAO,MAAM;wBACrB,SACEA,OAAO,OAAO,IACd,GAAGZ,aAAaA,GAAGC,qBAAqBA,GAAGc,aAAa;oBAC5D;oBACA,OAAOX,sBAAsB,CAACY,YAAY,YAAY,CAACD;gBACzD;;WAbSF;IAgBf;IAEA,MAAM,eAAeH,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,MAAMO,eAAe,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAEP;QACtD,qBACE,KAACX,IAAIA;;gBACFkB;gBACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAACL,QAAQG,cACzBH,OAAO,YAAY,CAACG,aAAa,IAAI,CAAC,WAAW;;WAH1C,IAAI,CAAC,EAAE;IAOtB;;QAzEK,qBACE,OAAO,SACP,UAAwB,EAAE,OAC1B,cAAcV,oBAAoB;;AAuE3C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import type { HtVideoNode } from './hubtype-fields';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import type { HtVideoNode } from './hubtype-fields/index.js';
|
|
4
4
|
export declare class FlowVideo extends ContentFieldsBase {
|
|
5
5
|
src: string;
|
|
6
6
|
static fromHubtypeCMS(component: HtVideoNode, locale: string): FlowVideo;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Video } from "@botonic/react";
|
|
3
|
+
import { trackOneContent } from "../tracking.js";
|
|
4
|
+
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FlowVideo extends ContentFieldsBase {
|
|
15
|
+
static fromHubtypeCMS(component, locale) {
|
|
16
|
+
const newVideo = new FlowVideo(component.id);
|
|
17
|
+
newVideo.code = component.code;
|
|
18
|
+
newVideo.src = FlowVideo.getVideoByLocale(locale, component.content.video);
|
|
19
|
+
newVideo.followUp = component.follow_up;
|
|
20
|
+
return newVideo;
|
|
21
|
+
}
|
|
22
|
+
async trackFlow(botContext) {
|
|
23
|
+
await trackOneContent(botContext, this);
|
|
24
|
+
}
|
|
25
|
+
async processContent(botContext) {
|
|
26
|
+
await this.filterContent(botContext, this);
|
|
27
|
+
await this.trackFlow(botContext);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
toBotonic() {
|
|
31
|
+
return /*#__PURE__*/ jsx(Video, {
|
|
32
|
+
src: this.src
|
|
33
|
+
}, this.id);
|
|
34
|
+
}
|
|
35
|
+
constructor(...args){
|
|
36
|
+
super(...args), this.src = '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { FlowVideo };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=flow-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-fields/flow-video.js","sources":["../../src/content-fields/flow-video.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Video } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtVideoNode } from './hubtype-fields'\n\nexport class FlowVideo extends ContentFieldsBase {\n public src = ''\n\n static fromHubtypeCMS(component: HtVideoNode, locale: string): FlowVideo {\n const newVideo = new FlowVideo(component.id)\n newVideo.code = component.code\n newVideo.src = FlowVideo.getVideoByLocale(locale, component.content.video)\n newVideo.followUp = component.follow_up\n\n return newVideo\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <Video key={this.id} src={this.src} />\n }\n}\n"],"names":["Video","trackOneContent","ContentFieldsBase","FlowVideo","component","locale","newVideo","botContext"],"mappings":";;;;;;;;;;AACsC;AAEO;AACY;AAGlD,MAAMG,SAASA,SAASD,iBAAiBA;IAG9C,OAAO,eAAeE,SAAsB,EAAEC,MAAc,EAAa;QACvE,MAAMC,WAAW,IAAIH,SAASA,CAACC,UAAU,EAAE;QAC3CE,SAAS,IAAI,GAAGF,UAAU,IAAI;QAC9BE,SAAS,GAAG,GAAGH,SAASA,CAAC,gBAAgB,CAACE,QAAQD,UAAU,OAAO,CAAC,KAAK;QACzEE,SAAS,QAAQ,GAAGF,UAAU,SAAS;QAEvC,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMN,eAAeA,CAACM,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO,IAACP,KAAKA;YAAe,KAAK,IAAI,CAAC,GAAG;WAAtB,IAAI,CAAC,EAAE;IAC5B;;QAxBK,qBACE,MAAM;;AAwBf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import type { HtWebviewExits, HtWebviewNode } from './hubtype-fields';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import type { HtWebviewExits, HtWebviewNode } from './hubtype-fields/index.js';
|
|
4
4
|
export declare class FlowWebview extends ContentFieldsBase {
|
|
5
5
|
webviewTargetId: string;
|
|
6
6
|
webviewName: string;
|