@nyaruka/temba-components 0.139.0 → 0.141.0
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/.github/workflows/cla.yml +1 -1
- package/.github/workflows/copilot-setup-steps.yml +6 -1
- package/.lintstagedrc.js +10 -0
- package/CHANGELOG.md +32 -0
- package/demo/data/flows/sample-flow.json +24 -0
- package/dist/locales/es.js +5 -5
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +5 -5
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/locale-codes.js +11 -2
- package/dist/locales/locale-codes.js.map +1 -1
- package/dist/locales/pt.js +5 -5
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +702 -338
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/Chat.js +10 -7
- package/out-tsc/src/display/Chat.js.map +1 -1
- package/out-tsc/src/display/Dropdown.js +3 -1
- package/out-tsc/src/display/Dropdown.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js +4 -4
- package/out-tsc/src/display/FloatingTab.js.map +1 -1
- package/out-tsc/src/display/Thumbnail.js +163 -5
- package/out-tsc/src/display/Thumbnail.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +65 -23
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +369 -49
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +118 -10
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +61 -14
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/StickyNote.js +13 -4
- package/out-tsc/src/flow/StickyNote.js.map +1 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js +4 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/add_input_labels.js +4 -1
- package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -1
- package/out-tsc/src/flow/actions/audio-player.js +112 -0
- package/out-tsc/src/flow/actions/audio-player.js.map +1 -0
- package/out-tsc/src/flow/actions/enter_flow.js +43 -0
- package/out-tsc/src/flow/actions/enter_flow.js.map +1 -0
- package/out-tsc/src/flow/actions/play_audio.js +57 -4
- package/out-tsc/src/flow/actions/play_audio.js.map +1 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js +6 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/say_msg.js +86 -3
- package/out-tsc/src/flow/actions/say_msg.js.map +1 -1
- package/out-tsc/src/flow/actions/send_broadcast.js +6 -2
- package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js +13 -0
- package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_status.js +7 -5
- package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
- package/out-tsc/src/flow/actions/start_session.js +10 -3
- package/out-tsc/src/flow/actions/start_session.js.map +1 -1
- package/out-tsc/src/flow/config.js +11 -3
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/shared-rules.js +1 -1
- package/out-tsc/src/flow/nodes/shared-rules.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_contact_field.js +18 -5
- package/out-tsc/src/flow/nodes/split_by_contact_field.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_expression.js +1 -1
- package/out-tsc/src/flow/nodes/split_by_expression.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +0 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_random.js +0 -1
- package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_run_result.js +10 -4
- package/out-tsc/src/flow/nodes/split_by_run_result.js.map +1 -1
- package/out-tsc/src/flow/nodes/terminal.js +7 -0
- package/out-tsc/src/flow/nodes/terminal.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js +77 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_dial.js +151 -0
- package/out-tsc/src/flow/nodes/wait_for_dial.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_digits.js +61 -1
- package/out-tsc/src/flow/nodes/wait_for_digits.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_menu.js +173 -2
- package/out-tsc/src/flow/nodes/wait_for_menu.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/flow/operators.js +21 -5
- package/out-tsc/src/flow/operators.js.map +1 -1
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/flow/utils.js +79 -3
- package/out-tsc/src/flow/utils.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +4 -2
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/FieldRenderer.js +56 -0
- package/out-tsc/src/form/FieldRenderer.js.map +1 -1
- package/out-tsc/src/interfaces.js +1 -0
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/layout/Dialog.js +51 -7
- package/out-tsc/src/layout/Dialog.js.map +1 -1
- package/out-tsc/src/layout/Modax.js +20 -2
- package/out-tsc/src/layout/Modax.js.map +1 -1
- package/out-tsc/src/list/ContentMenu.js +14 -1
- package/out-tsc/src/list/ContentMenu.js.map +1 -1
- package/out-tsc/src/locales/es.js +5 -5
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +5 -5
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/locale-codes.js +11 -2
- package/out-tsc/src/locales/locale-codes.js.map +1 -1
- package/out-tsc/src/locales/pt.js +5 -5
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/simulator/Simulator.js +21 -4
- package/out-tsc/src/simulator/Simulator.js.map +1 -1
- package/out-tsc/src/store/AppState.js +102 -3
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/test/actions/add_contact_groups.test.js +35 -0
- package/out-tsc/test/actions/add_contact_groups.test.js.map +1 -1
- package/out-tsc/test/actions/add_input_labels.test.js +53 -0
- package/out-tsc/test/actions/add_input_labels.test.js.map +1 -0
- package/out-tsc/test/actions/enter_flow.test.js +71 -0
- package/out-tsc/test/actions/enter_flow.test.js.map +1 -0
- package/out-tsc/test/actions/play_audio.test.js +118 -0
- package/out-tsc/test/actions/play_audio.test.js.map +1 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js +24 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js.map +1 -1
- package/out-tsc/test/actions/say_msg.test.js +158 -0
- package/out-tsc/test/actions/say_msg.test.js.map +1 -0
- package/out-tsc/test/actions/send_broadcast.test.js +41 -0
- package/out-tsc/test/actions/send_broadcast.test.js.map +1 -1
- package/out-tsc/test/actions/set_contact_channel.test.js +67 -0
- package/out-tsc/test/actions/set_contact_channel.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_field.test.js +52 -0
- package/out-tsc/test/actions/set_contact_field.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_language.test.js +39 -0
- package/out-tsc/test/actions/set_contact_language.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_name.test.js +28 -0
- package/out-tsc/test/actions/set_contact_name.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_status.test.js +44 -0
- package/out-tsc/test/actions/set_contact_status.test.js.map +1 -0
- package/out-tsc/test/actions/set_run_result.test.js +47 -0
- package/out-tsc/test/actions/set_run_result.test.js.map +1 -0
- package/out-tsc/test/actions/start_session.test.js +76 -0
- package/out-tsc/test/actions/start_session.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_contact_field.test.js +50 -0
- package/out-tsc/test/nodes/split_by_contact_field.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_run_result.test.js +82 -0
- package/out-tsc/test/nodes/split_by_run_result.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_ticket.test.js +139 -0
- package/out-tsc/test/nodes/split_by_ticket.test.js.map +1 -0
- package/out-tsc/test/nodes/split_by_webhook.test.js +111 -0
- package/out-tsc/test/nodes/split_by_webhook.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_audio.test.js +156 -0
- package/out-tsc/test/nodes/wait_for_audio.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_dial.test.js +336 -0
- package/out-tsc/test/nodes/wait_for_dial.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_digits.test.js +198 -84
- package/out-tsc/test/nodes/wait_for_digits.test.js.map +1 -1
- package/out-tsc/test/nodes/wait_for_menu.test.js +340 -0
- package/out-tsc/test/nodes/wait_for_menu.test.js.map +1 -0
- package/out-tsc/test/temba-flow-collision.test.js +261 -6
- package/out-tsc/test/temba-flow-collision.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor.test.js +187 -0
- package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber.test.js +19 -0
- package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
- package/out-tsc/test/temba-node-type-selector.test.js +6 -6
- package/out-tsc/test/temba-node-type-selector.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +4 -1
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +4 -2
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +3 -9
- package/screenshots/truth/actions/add_contact_groups/render/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/expression-facebook.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/expression-phone.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/facebook-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/instagram-handle.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/line-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/phone-number.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/telegram-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/viber-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/wechat-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/whatsapp.png +0 -0
- package/screenshots/truth/actions/add_input_labels/editor/multiple-labels.png +0 -0
- package/screenshots/truth/actions/add_input_labels/editor/single-label.png +0 -0
- package/screenshots/truth/actions/add_input_labels/render/multiple-labels.png +0 -0
- package/screenshots/truth/actions/add_input_labels/render/single-label.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/basic-flow.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/long-flow-name.png +0 -0
- package/screenshots/truth/actions/enter_flow/render/basic-flow.png +0 -0
- package/screenshots/truth/actions/enter_flow/render/long-flow-name.png +0 -0
- package/screenshots/truth/actions/play_audio/editor/expression-url.png +0 -0
- package/screenshots/truth/actions/play_audio/editor/static-url.png +0 -0
- package/screenshots/truth/actions/play_audio/render/expression-url.png +0 -0
- package/screenshots/truth/actions/play_audio/render/static-url.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/multiline-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/text-with-audio-url.png +0 -0
- package/screenshots/truth/actions/say_msg/render/multiline-text.png +0 -0
- package/screenshots/truth/actions/say_msg/render/simple-text.png +0 -0
- package/screenshots/truth/actions/say_msg/render/text-with-audio-url.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/contacts-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/groups-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/many-groups.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/multiline-text.png +0 -0
- package/screenshots/truth/actions/send_email/render/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/render/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/render/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/with-expressions.png +0 -0
- package/screenshots/truth/actions/send_msg/render/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-without-quick-replies.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/sms-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/whatsapp-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/render/sms-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/render/whatsapp-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/clear-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/set-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/render/clear-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/render/set-value.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/english.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/french.png +0 -0
- package/screenshots/truth/actions/set_contact_language/render/english.png +0 -0
- package/screenshots/truth/actions/set_contact_language/render/french.png +0 -0
- package/screenshots/truth/actions/set_contact_name/editor/expression-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/editor/static-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/render/expression-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/render/static-name.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/active.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/archived.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/blocked.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/active.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/archived.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/blocked.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/expression-value.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/with-category.png +0 -0
- package/screenshots/truth/actions/set_run_result/render/expression-value.png +0 -0
- package/screenshots/truth/actions/set_run_result/render/with-category.png +0 -0
- package/screenshots/truth/actions/start_session/render/contact-query.png +0 -0
- package/screenshots/truth/actions/start_session/render/contacts-only.png +0 -0
- package/screenshots/truth/actions/start_session/render/create-contact.png +0 -0
- package/screenshots/truth/actions/start_session/render/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/start_session/render/groups-only.png +0 -0
- package/screenshots/truth/actions/start_session/render/many-recipients.png +0 -0
- package/screenshots/truth/editor/router.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_audio/editor/basic-audio-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_audio/render/basic-audio-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/editor/basic-dial.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/editor/dial-with-limits.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/render/basic-dial.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/render/dial-with-limits.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/digits-with-rules.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/digits-with-rules.png +0 -0
- package/screenshots/truth/nodes/wait_for_menu/editor/menu-with-digits.png +0 -0
- package/screenshots/truth/nodes/wait_for_menu/render/menu-with-digits.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/short-timeout.png +0 -0
- package/src/display/Chat.ts +13 -7
- package/src/display/Dropdown.ts +3 -1
- package/src/display/FloatingTab.ts +4 -4
- package/src/display/Thumbnail.ts +162 -2
- package/src/flow/CanvasNode.ts +70 -24
- package/src/flow/Editor.ts +440 -99
- package/src/flow/NodeEditor.ts +137 -9
- package/src/flow/Plumber.ts +89 -14
- package/src/flow/StickyNote.ts +14 -4
- package/src/flow/actions/add_contact_groups.ts +4 -1
- package/src/flow/actions/add_input_labels.ts +4 -1
- package/src/flow/actions/audio-player.ts +127 -0
- package/src/flow/actions/enter_flow.ts +44 -0
- package/src/flow/actions/play_audio.ts +64 -5
- package/src/flow/actions/remove_contact_groups.ts +6 -1
- package/src/flow/actions/say_msg.ts +94 -4
- package/src/flow/actions/send_broadcast.ts +6 -2
- package/src/flow/actions/set_contact_channel.ts +13 -1
- package/src/flow/actions/set_contact_status.ts +7 -5
- package/src/flow/actions/start_session.ts +10 -3
- package/src/flow/config.ts +11 -3
- package/src/flow/nodes/shared-rules.ts +1 -1
- package/src/flow/nodes/split_by_contact_field.ts +16 -5
- package/src/flow/nodes/split_by_expression.ts +1 -1
- package/src/flow/nodes/split_by_llm_categorize.ts +0 -1
- package/src/flow/nodes/split_by_random.ts +0 -1
- package/src/flow/nodes/split_by_run_result.ts +10 -4
- package/src/flow/nodes/terminal.ts +9 -0
- package/src/flow/nodes/wait_for_audio.ts +88 -0
- package/src/flow/nodes/wait_for_dial.ts +176 -0
- package/src/flow/nodes/wait_for_digits.ts +87 -2
- package/src/flow/nodes/wait_for_menu.ts +209 -3
- package/src/flow/nodes/wait_for_response.ts +1 -1
- package/src/flow/operators.ts +23 -5
- package/src/flow/types.ts +23 -1
- package/src/flow/utils.ts +82 -3
- package/src/form/ArrayEditor.ts +4 -2
- package/src/form/FieldRenderer.ts +71 -1
- package/src/interfaces.ts +2 -1
- package/src/layout/Dialog.ts +52 -7
- package/src/layout/Modax.ts +19 -2
- package/src/list/ContentMenu.ts +15 -1
- package/src/locales/es.ts +18 -13
- package/src/locales/fr.ts +18 -13
- package/src/locales/locale-codes.ts +11 -2
- package/src/locales/pt.ts +18 -13
- package/src/simulator/Simulator.ts +25 -4
- package/src/store/AppState.ts +120 -1
- package/src/store/flow-definition.d.ts +2 -0
- package/test/actions/add_contact_groups.test.ts +38 -0
- package/test/actions/add_input_labels.test.ts +67 -0
- package/test/actions/enter_flow.test.ts +88 -0
- package/test/actions/play_audio.test.ts +155 -0
- package/test/actions/remove_contact_groups.test.ts +29 -0
- package/test/actions/say_msg.test.ts +196 -0
- package/test/actions/send_broadcast.test.ts +44 -0
- package/test/actions/set_contact_channel.test.ts +88 -0
- package/test/actions/set_contact_field.test.ts +68 -0
- package/test/actions/set_contact_language.test.ts +55 -0
- package/test/actions/set_contact_name.test.ts +39 -0
- package/test/actions/set_contact_status.test.ts +64 -0
- package/test/actions/set_run_result.test.ts +61 -0
- package/test/actions/start_session.test.ts +82 -0
- package/test/nodes/split_by_contact_field.test.ts +59 -0
- package/test/nodes/split_by_run_result.test.ts +100 -0
- package/test/nodes/split_by_ticket.test.ts +157 -0
- package/test/nodes/split_by_webhook.test.ts +131 -0
- package/test/nodes/wait_for_audio.test.ts +182 -0
- package/test/nodes/wait_for_dial.test.ts +382 -0
- package/test/nodes/wait_for_digits.test.ts +233 -109
- package/test/nodes/wait_for_menu.test.ts +383 -0
- package/test/temba-flow-collision.test.ts +286 -6
- package/test/temba-flow-editor.test.ts +240 -0
- package/test/temba-flow-plumber.test.ts +62 -0
- package/test/temba-node-type-selector.test.ts +6 -6
- package/test/temba-select.test.ts +6 -1
- package/test/utils.test.ts +4 -2
- package/screenshots/truth/nodes/wait_for_digits/editor/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/verification-code.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/verification-code.png +0 -0
|
@@ -6,6 +6,7 @@ import { NODE_CONFIG, ACTION_CONFIG } from './config';
|
|
|
6
6
|
import { ACTION_GROUP_METADATA, SPLIT_GROUP_METADATA } from './types';
|
|
7
7
|
import { CustomEventType } from '../interfaces';
|
|
8
8
|
import { generateUUID } from '../utils';
|
|
9
|
+
import { formatIssueMessage } from './utils';
|
|
9
10
|
import { FieldRenderer } from '../form/FieldRenderer';
|
|
10
11
|
import { renderMarkdownInline } from '../markdown';
|
|
11
12
|
import { fromStore, zustand } from '../store/AppState';
|
|
@@ -50,6 +51,19 @@ export class NodeEditor extends RapidElement {
|
|
|
50
51
|
margin-top: 15px;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
.issue-warning {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
color: var(--color-error, tomato);
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.issue-warning:hover .issue-text {
|
|
64
|
+
text-decoration: underline;
|
|
65
|
+
}
|
|
66
|
+
|
|
53
67
|
.form-actions {
|
|
54
68
|
display: flex;
|
|
55
69
|
gap: 10px;
|
|
@@ -107,12 +121,29 @@ export class NodeEditor extends RapidElement {
|
|
|
107
121
|
color: var(--color-label, #777);
|
|
108
122
|
}
|
|
109
123
|
|
|
124
|
+
.form-row-inline-label {
|
|
125
|
+
font-size: 20px;
|
|
126
|
+
font-weight: 300;
|
|
127
|
+
color: #ccc;
|
|
128
|
+
min-width: 20px;
|
|
129
|
+
text-align: center;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
user-select: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
110
136
|
.form-row-help {
|
|
111
137
|
font-size: 12px;
|
|
112
138
|
color: #666;
|
|
113
139
|
margin-top: 6px;
|
|
114
140
|
}
|
|
115
141
|
|
|
142
|
+
.form-text {
|
|
143
|
+
color: #666;
|
|
144
|
+
font-size: 13px;
|
|
145
|
+
}
|
|
146
|
+
|
|
116
147
|
.form-group {
|
|
117
148
|
border: 1px solid #e0e0e0;
|
|
118
149
|
border-radius: 6px;
|
|
@@ -397,7 +428,11 @@ export class NodeEditor extends RapidElement {
|
|
|
397
428
|
initializeFormData() {
|
|
398
429
|
var _a, _b, _c, _d, _e;
|
|
399
430
|
const nodeConfig = this.getNodeConfig();
|
|
400
|
-
|
|
431
|
+
// Temporary: terminal nodes defer to action configs, same as execute_actions
|
|
432
|
+
if ((!nodeConfig ||
|
|
433
|
+
nodeConfig.type === 'execute_actions' ||
|
|
434
|
+
nodeConfig.type === 'terminal') &&
|
|
435
|
+
this.action) {
|
|
401
436
|
// Action editing mode - use action config
|
|
402
437
|
const actionConfig = ACTION_CONFIG[this.action.type];
|
|
403
438
|
// Check if we're in localization mode
|
|
@@ -516,8 +551,11 @@ export class NodeEditor extends RapidElement {
|
|
|
516
551
|
// If we have a node and nodeUI, check if we should use node config
|
|
517
552
|
if (this.node && this.nodeUI) {
|
|
518
553
|
const nodeConfig = this.getNodeConfig();
|
|
519
|
-
//
|
|
520
|
-
|
|
554
|
+
// Temporary: terminal nodes defer to action configs for editing, same as execute_actions
|
|
555
|
+
// For execute_actions/terminal nodes, defer to action editing if an action is selected
|
|
556
|
+
if ((this.nodeUI.type === 'execute_actions' ||
|
|
557
|
+
this.nodeUI.type === 'terminal') &&
|
|
558
|
+
this.action) {
|
|
521
559
|
return ACTION_CONFIG[this.action.type] || null;
|
|
522
560
|
}
|
|
523
561
|
// For all other nodes with a config, use the node config
|
|
@@ -1181,6 +1219,7 @@ export class NodeEditor extends RapidElement {
|
|
|
1181
1219
|
return FieldRenderer.renderField(fieldName, fieldConfig, value, {
|
|
1182
1220
|
errors,
|
|
1183
1221
|
onChange: (e) => {
|
|
1222
|
+
var _a, _b;
|
|
1184
1223
|
// Handle different change event types
|
|
1185
1224
|
if (fieldName && config.type === 'key-value') {
|
|
1186
1225
|
// Special handling for key-value editor
|
|
@@ -1197,6 +1236,12 @@ export class NodeEditor extends RapidElement {
|
|
|
1197
1236
|
// Special handling for message editor
|
|
1198
1237
|
this.handleMessageEditorChange(fieldName, e);
|
|
1199
1238
|
}
|
|
1239
|
+
else if (fieldName && config.type === 'media') {
|
|
1240
|
+
// Extract URL from media picker's attachment
|
|
1241
|
+
const picker = e.target;
|
|
1242
|
+
const url = ((_b = (_a = picker.attachments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url) || '';
|
|
1243
|
+
this.handleNewFieldChange(fieldName, url);
|
|
1244
|
+
}
|
|
1200
1245
|
else {
|
|
1201
1246
|
// Default handling for most field types
|
|
1202
1247
|
this.handleFormFieldChange(fieldName, e);
|
|
@@ -1276,12 +1321,16 @@ export class NodeEditor extends RapidElement {
|
|
|
1276
1321
|
return this.renderRow(item, config, renderedFields);
|
|
1277
1322
|
case 'group':
|
|
1278
1323
|
return this.renderGroup(item, config, renderedFields);
|
|
1324
|
+
case 'spacer':
|
|
1325
|
+
return html ``;
|
|
1326
|
+
case 'text':
|
|
1327
|
+
return html `<div class="form-text">${item.text}</div>`;
|
|
1279
1328
|
default:
|
|
1280
1329
|
return html ``;
|
|
1281
1330
|
}
|
|
1282
1331
|
}
|
|
1283
1332
|
renderRow(rowConfig, config, renderedFields) {
|
|
1284
|
-
const { items, gap = '1rem', label, helpText } = rowConfig;
|
|
1333
|
+
const { items, gap = '1rem', label, helpText, inlineLabels, marginBottom } = rowConfig;
|
|
1285
1334
|
// Collect all fields from this row for width calculations
|
|
1286
1335
|
const fieldsInRow = this.collectFieldsFromItems(items);
|
|
1287
1336
|
const validFields = fieldsInRow.filter((fieldName) => { var _a; return (_a = config.form) === null || _a === void 0 ? void 0 : _a[fieldName]; });
|
|
@@ -1309,8 +1358,17 @@ export class NodeEditor extends RapidElement {
|
|
|
1309
1358
|
}
|
|
1310
1359
|
});
|
|
1311
1360
|
const rowContent = html `
|
|
1312
|
-
<div
|
|
1361
|
+
<div
|
|
1362
|
+
class="form-row"
|
|
1363
|
+
style="display: flex; gap: ${gap};${marginBottom
|
|
1364
|
+
? ` margin-bottom: ${marginBottom};`
|
|
1365
|
+
: ''}"
|
|
1366
|
+
>
|
|
1313
1367
|
${items.map((item) => {
|
|
1368
|
+
// Spacer items render as empty flex children
|
|
1369
|
+
if (typeof item !== 'string' && item.type === 'spacer') {
|
|
1370
|
+
return html `<div style="flex: 1 1 0;"></div>`;
|
|
1371
|
+
}
|
|
1314
1372
|
// Get the field name from the item
|
|
1315
1373
|
const fieldName = typeof item === 'string'
|
|
1316
1374
|
? item
|
|
@@ -1322,10 +1380,20 @@ export class NodeEditor extends RapidElement {
|
|
|
1322
1380
|
? fieldFlexStyles.get(fieldName)
|
|
1323
1381
|
: '';
|
|
1324
1382
|
const itemContent = this.renderLayoutItem(item, config, renderedFields);
|
|
1383
|
+
// When inlineLabels is provided, render the label inline to the left
|
|
1384
|
+
const inlineLabel = inlineLabels && fieldName ? inlineLabels[fieldName] : null;
|
|
1325
1385
|
// Wrap in a div with flex style if we have a flex style
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1386
|
+
if (flexStyle) {
|
|
1387
|
+
return inlineLabel
|
|
1388
|
+
? html `<div
|
|
1389
|
+
style="${flexStyle} display: flex; align-items: center; gap: 0.35rem;"
|
|
1390
|
+
>
|
|
1391
|
+
<span class="form-row-inline-label">${inlineLabel}</span>
|
|
1392
|
+
<div style="flex: 1 1 0; min-width: 0;">${itemContent}</div>
|
|
1393
|
+
</div>`
|
|
1394
|
+
: html `<div style="${flexStyle}">${itemContent}</div>`;
|
|
1395
|
+
}
|
|
1396
|
+
return itemContent;
|
|
1329
1397
|
})}
|
|
1330
1398
|
</div>
|
|
1331
1399
|
`;
|
|
@@ -1640,8 +1708,36 @@ export class NodeEditor extends RapidElement {
|
|
|
1640
1708
|
</div>
|
|
1641
1709
|
`;
|
|
1642
1710
|
}
|
|
1643
|
-
|
|
1711
|
+
handleIssueClick(issue) {
|
|
1712
|
+
this.fireCustomEvent(CustomEventType.ShowIssue, { issue });
|
|
1713
|
+
}
|
|
1714
|
+
renderIssueWarnings() {
|
|
1644
1715
|
var _a, _b;
|
|
1716
|
+
const issues = [];
|
|
1717
|
+
// Check for action-level issues
|
|
1718
|
+
if (this.action && ((_a = this.issuesByAction) === null || _a === void 0 ? void 0 : _a.has(this.action.uuid))) {
|
|
1719
|
+
issues.push(...this.issuesByAction.get(this.action.uuid));
|
|
1720
|
+
}
|
|
1721
|
+
// Check for node-level issues (issues without action_uuid)
|
|
1722
|
+
if (this.node && ((_b = this.issuesByNode) === null || _b === void 0 ? void 0 : _b.has(this.node.uuid))) {
|
|
1723
|
+
issues.push(...this.issuesByNode.get(this.node.uuid));
|
|
1724
|
+
}
|
|
1725
|
+
if (issues.length === 0)
|
|
1726
|
+
return '';
|
|
1727
|
+
return html `
|
|
1728
|
+
${issues.map((issue) => html `
|
|
1729
|
+
<div
|
|
1730
|
+
class="issue-warning"
|
|
1731
|
+
@click=${() => this.handleIssueClick(issue)}
|
|
1732
|
+
>
|
|
1733
|
+
<temba-icon name="alert_warning" size="1.2"></temba-icon>
|
|
1734
|
+
<span class="issue-text">${formatIssueMessage(issue)}</span>
|
|
1735
|
+
</div>
|
|
1736
|
+
`)}
|
|
1737
|
+
`;
|
|
1738
|
+
}
|
|
1739
|
+
render() {
|
|
1740
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1645
1741
|
if (!this.isOpen) {
|
|
1646
1742
|
return html ``;
|
|
1647
1743
|
}
|
|
@@ -1660,6 +1756,8 @@ export class NodeEditor extends RapidElement {
|
|
|
1660
1756
|
<temba-dialog
|
|
1661
1757
|
header="${header}"
|
|
1662
1758
|
.open="${this.isOpen}"
|
|
1759
|
+
.originX=${(_b = (_a = this.dialogOrigin) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : null}
|
|
1760
|
+
.originY=${(_d = (_c = this.dialogOrigin) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : null}
|
|
1663
1761
|
@temba-button-clicked=${this.handleDialogButtonClick}
|
|
1664
1762
|
primaryButtonName="Save"
|
|
1665
1763
|
cancelButtonName="Cancel"
|
|
@@ -1668,9 +1766,10 @@ export class NodeEditor extends RapidElement {
|
|
|
1668
1766
|
>
|
|
1669
1767
|
<div class="node-editor-form">
|
|
1670
1768
|
${this.renderFields()}
|
|
1671
|
-
${((
|
|
1769
|
+
${((_f = (_e = this.getNodeConfig()) === null || _e === void 0 ? void 0 : _e.router) === null || _f === void 0 ? void 0 : _f.configurable)
|
|
1672
1770
|
? this.renderRouterSection()
|
|
1673
1771
|
: null}
|
|
1772
|
+
${this.renderIssueWarnings()}
|
|
1674
1773
|
</div>
|
|
1675
1774
|
|
|
1676
1775
|
<div slot="gutter">${this.renderGutter()}</div>
|
|
@@ -1687,6 +1786,9 @@ __decorate([
|
|
|
1687
1786
|
__decorate([
|
|
1688
1787
|
property({ type: Object })
|
|
1689
1788
|
], NodeEditor.prototype, "nodeUI", void 0);
|
|
1789
|
+
__decorate([
|
|
1790
|
+
property({ attribute: false })
|
|
1791
|
+
], NodeEditor.prototype, "dialogOrigin", void 0);
|
|
1690
1792
|
__decorate([
|
|
1691
1793
|
property({ type: Boolean })
|
|
1692
1794
|
], NodeEditor.prototype, "isOpen", void 0);
|
|
@@ -1717,4 +1819,10 @@ __decorate([
|
|
|
1717
1819
|
__decorate([
|
|
1718
1820
|
fromStore(zustand, (state) => state.flowDefinition)
|
|
1719
1821
|
], NodeEditor.prototype, "flowDefinition", void 0);
|
|
1822
|
+
__decorate([
|
|
1823
|
+
fromStore(zustand, (state) => state.issuesByNode)
|
|
1824
|
+
], NodeEditor.prototype, "issuesByNode", void 0);
|
|
1825
|
+
__decorate([
|
|
1826
|
+
fromStore(zustand, (state) => state.issuesByAction)
|
|
1827
|
+
], NodeEditor.prototype, "issuesByAction", void 0);
|
|
1720
1828
|
//# sourceMappingURL=NodeEditor.js.map
|