@nyaruka/temba-components 0.129.2 → 0.129.4
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/.eslintrc.js +1 -0
- package/.github/workflows/build.yml +141 -8
- package/CHANGELOG.md +40 -0
- package/README.md +6 -0
- package/check-coverage.js +133 -0
- package/demo/data/flows/sample-flow.json +158 -128
- package/demo/field-config-demo.html +135 -0
- package/dist/temba-components.js +1750 -751
- package/dist/temba-components.js.map +1 -1
- package/docs/ActionEditor-Migration.md +118 -0
- package/generate-coverage-badge.sh +69 -0
- package/out-tsc/src/{vectoricon/index.js → Icons.js} +1 -1
- package/out-tsc/src/Icons.js.map +1 -0
- package/out-tsc/src/display/Alert.js.map +1 -0
- package/out-tsc/src/display/Anchor.js.map +1 -0
- package/out-tsc/src/display/Button.js.map +1 -0
- package/out-tsc/src/{charcount → display}/CharCount.js +159 -2
- package/out-tsc/src/display/CharCount.js.map +1 -0
- package/out-tsc/src/display/Chat.js.map +1 -0
- package/out-tsc/src/display/ContactName.js.map +1 -0
- package/out-tsc/src/display/ContactUrn.js.map +1 -0
- package/out-tsc/src/display/Dropdown.js.map +1 -0
- package/out-tsc/src/{vectoricon/VectorIcon.js → display/Icon.js} +2 -2
- package/out-tsc/src/display/Icon.js.map +1 -0
- package/out-tsc/src/display/Label.js.map +1 -0
- package/out-tsc/src/{leafletmap → display}/LeafletMap.js +16 -1
- package/out-tsc/src/display/LeafletMap.js.map +1 -0
- package/out-tsc/src/display/Lightbox.js.map +1 -0
- package/out-tsc/src/{loading → display}/Loading.js.map +1 -1
- package/out-tsc/src/{options → display}/Options.js.map +1 -1
- package/out-tsc/src/display/ProgressBar.js.map +1 -0
- package/out-tsc/src/display/TembaDate.js.map +1 -0
- package/out-tsc/src/display/TembaUser.js.map +1 -0
- package/out-tsc/src/display/Thumbnail.js.map +1 -0
- package/out-tsc/src/{tip → display}/Tip.js +1 -2
- package/out-tsc/src/display/Tip.js.map +1 -0
- package/out-tsc/src/display/Toast.js.map +1 -0
- package/out-tsc/src/display/sms/gsmsplitter.js.map +1 -0
- package/out-tsc/src/display/sms/gsmvalidator.js.map +1 -0
- package/out-tsc/src/display/sms/index.js.map +1 -0
- package/out-tsc/src/display/sms/unicodesplitter.js.map +1 -0
- package/out-tsc/src/events.js +2 -0
- package/out-tsc/src/events.js.map +1 -0
- package/out-tsc/src/excellent/ExcellentParser.js.map +1 -0
- package/out-tsc/src/excellent/helpers.js.map +1 -0
- package/out-tsc/src/flow/CanvasNode.js +861 -0
- package/out-tsc/src/flow/CanvasNode.js.map +1 -0
- package/out-tsc/src/flow/Editor.js +640 -143
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +1200 -0
- package/out-tsc/src/flow/NodeEditor.js.map +1 -0
- package/out-tsc/src/flow/Plumber.js +148 -74
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/StickyNote.js +153 -9
- package/out-tsc/src/flow/StickyNote.js.map +1 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js +40 -0
- package/out-tsc/src/flow/actions/add_contact_groups.js.map +1 -0
- package/out-tsc/src/flow/actions/add_contact_urn.js +16 -0
- package/out-tsc/src/flow/actions/add_contact_urn.js.map +1 -0
- package/out-tsc/src/flow/actions/add_input_labels.js +11 -0
- package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -0
- package/out-tsc/src/flow/actions/call_classifier.js +11 -0
- package/out-tsc/src/flow/actions/call_classifier.js.map +1 -0
- package/out-tsc/src/flow/actions/call_llm.js +11 -0
- package/out-tsc/src/flow/actions/call_llm.js.map +1 -0
- package/out-tsc/src/flow/actions/call_resthook.js +11 -0
- package/out-tsc/src/flow/actions/call_resthook.js.map +1 -0
- package/out-tsc/src/flow/actions/call_webhook.js +122 -0
- package/out-tsc/src/flow/actions/call_webhook.js.map +1 -0
- package/out-tsc/src/flow/actions/enter_flow.js +14 -0
- package/out-tsc/src/flow/actions/enter_flow.js.map +1 -0
- package/out-tsc/src/flow/actions/open_ticket.js +11 -0
- package/out-tsc/src/flow/actions/open_ticket.js.map +1 -0
- package/out-tsc/src/flow/actions/play_audio.js +11 -0
- package/out-tsc/src/flow/actions/play_audio.js.map +1 -0
- package/out-tsc/src/flow/actions/remove_contact_groups.js +62 -0
- package/out-tsc/src/flow/actions/remove_contact_groups.js.map +1 -0
- package/out-tsc/src/flow/actions/request_optin.js +11 -0
- package/out-tsc/src/flow/actions/request_optin.js.map +1 -0
- package/out-tsc/src/flow/actions/say_msg.js +11 -0
- package/out-tsc/src/flow/actions/say_msg.js.map +1 -0
- package/out-tsc/src/flow/actions/send_broadcast.js +33 -0
- package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -0
- package/out-tsc/src/flow/actions/send_email.js +56 -0
- package/out-tsc/src/flow/actions/send_email.js.map +1 -0
- package/out-tsc/src/flow/actions/send_msg.js +55 -0
- package/out-tsc/src/flow/actions/send_msg.js.map +1 -0
- package/out-tsc/src/flow/actions/set_contact_channel.js +12 -0
- package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -0
- package/out-tsc/src/flow/actions/set_contact_field.js +12 -0
- package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -0
- package/out-tsc/src/flow/actions/set_contact_language.js +10 -0
- package/out-tsc/src/flow/actions/set_contact_language.js.map +1 -0
- package/out-tsc/src/flow/actions/set_contact_name.js +10 -0
- package/out-tsc/src/flow/actions/set_contact_name.js.map +1 -0
- package/out-tsc/src/flow/actions/set_contact_status.js +10 -0
- package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -0
- package/out-tsc/src/flow/actions/set_run_result.js +10 -0
- package/out-tsc/src/flow/actions/set_run_result.js.map +1 -0
- package/out-tsc/src/flow/actions/split_by_expression_example.js +77 -0
- package/out-tsc/src/flow/actions/split_by_expression_example.js.map +1 -0
- package/out-tsc/src/flow/actions/start_session.js +11 -0
- package/out-tsc/src/flow/actions/start_session.js.map +1 -0
- package/out-tsc/src/flow/actions/transfer_airtime.js +11 -0
- package/out-tsc/src/flow/actions/transfer_airtime.js.map +1 -0
- package/out-tsc/src/flow/config.js +88 -123
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/execute_actions.js +4 -0
- package/out-tsc/src/flow/nodes/execute_actions.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_airtime.js +9 -0
- package/out-tsc/src/flow/nodes/split_by_airtime.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_contact_field.js +7 -0
- package/out-tsc/src/flow/nodes/split_by_contact_field.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_expression.js +7 -0
- package/out-tsc/src/flow/nodes/split_by_expression.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_groups.js +7 -0
- package/out-tsc/src/flow/nodes/split_by_groups.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_random.js +10 -0
- package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_run_result.js +7 -0
- package/out-tsc/src/flow/nodes/split_by_run_result.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_scheme.js +7 -0
- package/out-tsc/src/flow/nodes/split_by_scheme.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_subflow.js +9 -0
- package/out-tsc/src/flow/nodes/split_by_subflow.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_webhook.js +18 -0
- package/out-tsc/src/flow/nodes/split_by_webhook.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_digits.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_digits.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_image.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_image.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_location.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_location.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_menu.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_menu.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_response.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_video.js +7 -0
- package/out-tsc/src/flow/nodes/wait_for_video.js.map +1 -0
- package/out-tsc/src/flow/types.js +79 -0
- package/out-tsc/src/flow/types.js.map +1 -0
- package/out-tsc/src/flow/utils.js +65 -0
- package/out-tsc/src/flow/utils.js.map +1 -0
- package/out-tsc/src/form/ArrayEditor.js +199 -0
- package/out-tsc/src/form/ArrayEditor.js.map +1 -0
- package/out-tsc/src/form/BaseListEditor.js +128 -0
- package/out-tsc/src/form/BaseListEditor.js.map +1 -0
- package/out-tsc/src/{checkbox → form}/Checkbox.js +19 -4
- package/out-tsc/src/form/Checkbox.js.map +1 -0
- package/out-tsc/src/{colorpicker → form}/ColorPicker.js +1 -1
- package/out-tsc/src/form/ColorPicker.js.map +1 -0
- package/out-tsc/src/{completion → form}/Completion.js +8 -2
- package/out-tsc/src/form/Completion.js.map +1 -0
- package/out-tsc/src/{compose → form}/Compose.js +1 -1
- package/out-tsc/src/form/Compose.js.map +1 -0
- package/out-tsc/src/{contactsearch → form}/ContactSearch.js +2 -2
- package/out-tsc/src/form/ContactSearch.js.map +1 -0
- package/out-tsc/src/form/CroppieCSS.js.map +1 -0
- package/out-tsc/src/{datepicker → form}/DatePicker.js +1 -1
- package/out-tsc/src/form/DatePicker.js.map +1 -0
- package/out-tsc/src/{FormElement.js → form/FormElement.js} +1 -1
- package/out-tsc/src/form/FormElement.js.map +1 -0
- package/out-tsc/src/form/FormField.js +243 -0
- package/out-tsc/src/form/FormField.js.map +1 -0
- package/out-tsc/src/{imagepicker → form}/ImagePicker.js +2 -2
- package/out-tsc/src/form/ImagePicker.js.map +1 -0
- package/out-tsc/src/form/KeyValueEditor.js +223 -0
- package/out-tsc/src/form/KeyValueEditor.js.map +1 -0
- package/out-tsc/src/{mediapicker → form}/MediaPicker.js +1 -1
- package/out-tsc/src/form/MediaPicker.js.map +1 -0
- package/out-tsc/src/form/RangePicker.js.map +1 -0
- package/out-tsc/src/{slider → form}/TembaSlider.js +1 -1
- package/out-tsc/src/form/TembaSlider.js.map +1 -0
- package/out-tsc/src/{templates → form}/TemplateEditor.js +1 -1
- package/out-tsc/src/form/TemplateEditor.js.map +1 -0
- package/out-tsc/src/{textinput → form}/TextInput.js +3 -3
- package/out-tsc/src/form/TextInput.js.map +1 -0
- package/out-tsc/src/{omnibox → form/select}/Omnibox.js +2 -2
- package/out-tsc/src/form/select/Omnibox.js.map +1 -0
- package/out-tsc/src/{select → form/select}/PopupSelect.js +1 -1
- package/out-tsc/src/form/select/PopupSelect.js.map +1 -0
- package/out-tsc/src/{select → form/select}/Select.js +157 -113
- package/out-tsc/src/form/select/Select.js.map +1 -0
- package/out-tsc/src/{select → form/select}/UserSelect.js +1 -1
- package/out-tsc/src/form/select/UserSelect.js.map +1 -0
- package/out-tsc/src/{select → form/select}/WorkspaceSelect.js +1 -1
- package/out-tsc/src/form/select/WorkspaceSelect.js.map +1 -0
- package/out-tsc/src/interfaces.js +7 -0
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/layout/Dialog.js.map +1 -0
- package/out-tsc/src/layout/Mask.js.map +1 -0
- package/out-tsc/src/{dialog → layout}/Modax.js.map +1 -1
- package/out-tsc/src/layout/Resizer.js.map +1 -0
- package/out-tsc/src/layout/Tab.js.map +1 -0
- package/out-tsc/src/layout/TabPane.js.map +1 -0
- package/out-tsc/src/list/NotificationList.js +1 -1
- package/out-tsc/src/list/NotificationList.js.map +1 -1
- package/out-tsc/src/list/RunList.js +1 -1
- package/out-tsc/src/list/RunList.js.map +1 -1
- package/out-tsc/src/list/ShortcutList.js.map +1 -1
- package/out-tsc/src/list/TembaMenu.js +1 -1
- package/out-tsc/src/list/TembaMenu.js.map +1 -1
- package/out-tsc/src/list/TicketList.js +1 -1
- package/out-tsc/src/list/TicketList.js.map +1 -1
- package/out-tsc/src/{aliaseditor → live}/AliasEditor.js +1 -1
- package/out-tsc/src/live/AliasEditor.js.map +1 -0
- package/out-tsc/src/{contacts → live}/ContactBadges.js +1 -1
- package/out-tsc/src/live/ContactBadges.js.map +1 -0
- package/out-tsc/src/{contacts → live}/ContactChat.js +80 -78
- package/out-tsc/src/live/ContactChat.js.map +1 -0
- package/out-tsc/src/{contacts → live}/ContactDetails.js +1 -1
- package/out-tsc/src/live/ContactDetails.js.map +1 -0
- package/out-tsc/src/{contacts → live}/ContactFieldEditor.js +2 -2
- package/out-tsc/src/live/ContactFieldEditor.js.map +1 -0
- package/out-tsc/src/live/ContactFields.js.map +1 -0
- package/out-tsc/src/live/ContactNameFetch.js.map +1 -0
- package/out-tsc/src/{contacts → live}/ContactNotepad.js +1 -1
- package/out-tsc/src/{contacts → live}/ContactNotepad.js.map +1 -1
- package/out-tsc/src/{contacts → live}/ContactPending.js +1 -1
- package/out-tsc/src/live/ContactPending.js.map +1 -0
- package/out-tsc/src/live/ContactStoreElement.js.map +1 -0
- package/out-tsc/src/live/FieldManager.js.map +1 -0
- package/out-tsc/src/live/StartProgress.js.map +1 -0
- package/out-tsc/src/live/TembaChart.js.map +1 -0
- package/out-tsc/src/store/AppState.js +54 -24
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/src/store/Store.js +1 -1
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/{utils/index.js → utils.js} +22 -1
- package/out-tsc/src/utils.js.map +1 -0
- package/out-tsc/src/webchat/WebChat.js +1 -1
- package/out-tsc/src/webchat/WebChat.js.map +1 -1
- package/out-tsc/temba-components.js +2 -2
- package/out-tsc/temba-components.js.map +1 -1
- package/out-tsc/temba-modules.js +63 -56
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/temba-webchat.js +2 -2
- package/out-tsc/temba-webchat.js.map +1 -1
- package/out-tsc/test/ActionHelper.js +116 -0
- package/out-tsc/test/ActionHelper.js.map +1 -0
- package/out-tsc/test/actions/add_contact_groups.test.js +66 -0
- package/out-tsc/test/actions/add_contact_groups.test.js.map +1 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js +226 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js.map +1 -0
- package/out-tsc/test/actions/send_email.test.js +160 -0
- package/out-tsc/test/actions/send_email.test.js.map +1 -0
- package/out-tsc/test/actions/send_msg.test.js +95 -0
- package/out-tsc/test/actions/send_msg.test.js.map +1 -0
- package/out-tsc/test/temba-action-editing-integration.test.js +183 -0
- package/out-tsc/test/temba-action-editing-integration.test.js.map +1 -0
- package/out-tsc/test/temba-alert.test.js +1 -1
- package/out-tsc/test/temba-alert.test.js.map +1 -1
- package/out-tsc/test/temba-appstate-language.test.js +90 -0
- package/out-tsc/test/temba-appstate-language.test.js.map +1 -1
- package/out-tsc/test/temba-charcount.test.js.map +1 -1
- package/out-tsc/test/temba-chart.test.js +1 -1
- package/out-tsc/test/temba-chart.test.js.map +1 -1
- package/out-tsc/test/temba-checkbox.test.js +1 -1
- package/out-tsc/test/temba-checkbox.test.js.map +1 -1
- package/out-tsc/test/temba-color-picker.test.js +1 -1
- package/out-tsc/test/temba-color-picker.test.js.map +1 -1
- package/out-tsc/test/temba-completion.test.js +1 -1
- package/out-tsc/test/temba-completion.test.js.map +1 -1
- package/out-tsc/test/temba-compose.test.js +1 -1
- package/out-tsc/test/temba-compose.test.js.map +1 -1
- package/out-tsc/test/temba-contact-badges.test.js +1 -1
- package/out-tsc/test/temba-contact-badges.test.js.map +1 -1
- package/out-tsc/test/temba-contact-chat.test.js +3 -1
- package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
- package/out-tsc/test/temba-contact-details.test.js +1 -1
- package/out-tsc/test/temba-contact-details.test.js.map +1 -1
- package/out-tsc/test/temba-contact-fields.test.js +1 -1
- package/out-tsc/test/temba-contact-fields.test.js.map +1 -1
- package/out-tsc/test/temba-contact-search.test.js +1 -1
- package/out-tsc/test/temba-contact-search.test.js.map +1 -1
- package/out-tsc/test/temba-date.test.js +5 -1
- package/out-tsc/test/temba-date.test.js.map +1 -1
- package/out-tsc/test/temba-datepicker.test.js +1 -1
- package/out-tsc/test/temba-datepicker.test.js.map +1 -1
- package/out-tsc/test/temba-dialog.test.js +1 -1
- package/out-tsc/test/temba-dialog.test.js.map +1 -1
- package/out-tsc/test/temba-dropdown.test.js +1 -1
- package/out-tsc/test/temba-dropdown.test.js.map +1 -1
- package/out-tsc/test/temba-excellent-helpers.test.js +316 -0
- package/out-tsc/test/temba-excellent-helpers.test.js.map +1 -0
- package/out-tsc/test/temba-field-config.test.js +133 -0
- package/out-tsc/test/temba-field-config.test.js.map +1 -0
- package/out-tsc/test/temba-field-manager.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-node.test.js +426 -13
- package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor.test.js +185 -0
- package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber-connections.test.js +113 -0
- package/out-tsc/test/temba-flow-plumber-connections.test.js.map +1 -0
- package/out-tsc/test/temba-flow-plumber.test.js +73 -93
- package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
- package/out-tsc/test/temba-flow-self-routing.test.js +172 -0
- package/out-tsc/test/temba-flow-self-routing.test.js.map +1 -0
- package/out-tsc/test/temba-formfield.test.js.map +1 -1
- package/out-tsc/test/temba-icon.test.js +1 -1
- package/out-tsc/test/temba-icon.test.js.map +1 -1
- package/out-tsc/test/temba-integration-markdown.test.js.map +1 -1
- package/out-tsc/test/temba-label.test.js +1 -1
- package/out-tsc/test/temba-label.test.js.map +1 -1
- package/out-tsc/test/temba-lightbox.test.js +1 -1
- package/out-tsc/test/temba-lightbox.test.js.map +1 -1
- package/out-tsc/test/temba-markdown.test.js +127 -0
- package/out-tsc/test/temba-markdown.test.js.map +1 -0
- package/out-tsc/test/temba-menu.test.js +1 -1
- package/out-tsc/test/temba-menu.test.js.map +1 -1
- package/out-tsc/test/temba-modax.test.js +1 -1
- package/out-tsc/test/temba-modax.test.js.map +1 -1
- package/out-tsc/test/temba-modules.test.js +47 -0
- package/out-tsc/test/temba-modules.test.js.map +1 -0
- package/out-tsc/test/temba-node-editor.test.js +283 -0
- package/out-tsc/test/temba-node-editor.test.js.map +1 -0
- package/out-tsc/test/temba-omnibox.test.js +1 -1
- package/out-tsc/test/temba-omnibox.test.js.map +1 -1
- package/out-tsc/test/temba-options.test.js.map +1 -1
- package/out-tsc/test/temba-range-picker.test.js +9 -2
- package/out-tsc/test/temba-range-picker.test.js.map +1 -1
- package/out-tsc/test/temba-rapid-element.test.js +273 -0
- package/out-tsc/test/temba-rapid-element.test.js.map +1 -0
- package/out-tsc/test/temba-resize-element.test.js +85 -0
- package/out-tsc/test/temba-resize-element.test.js.map +1 -0
- package/out-tsc/test/temba-select.test.js +87 -2
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/temba-slider.test.js.map +1 -1
- package/out-tsc/test/temba-sticky-note.test.js +194 -0
- package/out-tsc/test/temba-sticky-note.test.js.map +1 -0
- package/out-tsc/test/temba-template-editor.test.js.map +1 -1
- package/out-tsc/test/temba-textinput.test.js +1 -1
- package/out-tsc/test/temba-textinput.test.js.map +1 -1
- package/out-tsc/test/temba-tip.test.js +1 -1
- package/out-tsc/test/temba-tip.test.js.map +1 -1
- package/out-tsc/test/temba-toast.test.js +1 -1
- package/out-tsc/test/temba-toast.test.js.map +1 -1
- package/out-tsc/test/temba-utils-index.test.js +1 -1
- package/out-tsc/test/temba-utils-index.test.js.map +1 -1
- package/out-tsc/test/temba-utils-uuid.test.js +38 -0
- package/out-tsc/test/temba-utils-uuid.test.js.map +1 -0
- package/out-tsc/test/temba-webchat.test.js +28 -12
- package/out-tsc/test/temba-webchat.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +2 -6
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +18 -9
- package/rollup.components.mjs +1 -1
- package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/single-group.png +0 -0
- 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/remove_contact_groups/editor/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/single-group.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/send_email/editor/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/with-expressions.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/editor/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.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/datepicker/range-picker-all.png +0 -0
- package/screenshots/truth/datepicker/range-picker-button-states.png +0 -0
- package/screenshots/truth/datepicker/range-picker-default.png +0 -0
- package/screenshots/truth/datepicker/range-picker-editing-start.png +0 -0
- package/screenshots/truth/datepicker/range-picker-initial-values.png +0 -0
- package/screenshots/truth/datepicker/range-picker-week.png +0 -0
- package/screenshots/truth/datepicker/range-picker-year.png +0 -0
- package/screenshots/truth/editor/router.png +0 -0
- package/screenshots/truth/editor/send_msg.png +0 -0
- package/screenshots/truth/editor/set_contact_language.png +0 -0
- package/screenshots/truth/editor/set_contact_name.png +0 -0
- package/screenshots/truth/editor/set_run_result.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/formfield/markdown-errors.png +0 -0
- package/screenshots/truth/formfield/plain-text-errors.png +0 -0
- package/screenshots/truth/formfield/widget-only-markdown-errors.png +0 -0
- package/screenshots/truth/integration/checkbox-markdown-errors.png +0 -0
- package/screenshots/truth/sticky-note/blue-color.png +0 -0
- package/screenshots/truth/sticky-note/blue.png +0 -0
- package/screenshots/truth/sticky-note/color-picker-expanded.png +0 -0
- package/screenshots/truth/sticky-note/default.png +0 -0
- package/screenshots/truth/sticky-note/gray-color.png +0 -0
- package/screenshots/truth/sticky-note/gray.png +0 -0
- package/screenshots/truth/sticky-note/green-color.png +0 -0
- package/screenshots/truth/sticky-note/green.png +0 -0
- package/screenshots/truth/sticky-note/pink-color.png +0 -0
- package/screenshots/truth/sticky-note/pink.png +0 -0
- package/screenshots/truth/sticky-note/yellow-color.png +0 -0
- package/screenshots/truth/sticky-note/yellow.png +0 -0
- package/src/{charcount → display}/CharCount.ts +164 -2
- package/src/{vectoricon/VectorIcon.ts → display/Icon.ts} +1 -1
- package/src/{leafletmap → display}/LeafletMap.ts +19 -1
- package/src/{thumbnail → display}/Thumbnail.ts +1 -1
- package/src/{tip → display}/Tip.ts +1 -2
- package/src/events.ts +108 -0
- package/src/flow/CanvasNode.ts +1009 -0
- package/src/flow/Editor.ts +795 -169
- package/src/flow/NodeEditor.ts +1443 -0
- package/src/flow/Plumber.ts +177 -79
- package/src/flow/StickyNote.ts +165 -9
- package/src/flow/actions/add_contact_groups.ts +42 -0
- package/src/flow/actions/add_contact_urn.ts +17 -0
- package/src/flow/actions/add_input_labels.ts +12 -0
- package/src/flow/actions/call_classifier.ts +12 -0
- package/src/flow/actions/call_llm.ts +12 -0
- package/src/flow/actions/call_resthook.ts +12 -0
- package/src/flow/actions/call_webhook.ts +133 -0
- package/src/flow/actions/enter_flow.ts +15 -0
- package/src/flow/actions/open_ticket.ts +12 -0
- package/src/flow/actions/play_audio.ts +12 -0
- package/src/flow/actions/remove_contact_groups.ts +66 -0
- package/src/flow/actions/request_optin.ts +12 -0
- package/src/flow/actions/say_msg.ts +12 -0
- package/src/flow/actions/send_broadcast.ts +35 -0
- package/src/flow/actions/send_email.ts +60 -0
- package/src/flow/actions/send_msg.ts +58 -0
- package/src/flow/actions/set_contact_channel.ts +13 -0
- package/src/flow/actions/set_contact_field.ts +13 -0
- package/src/flow/actions/set_contact_language.ts +11 -0
- package/src/flow/actions/set_contact_name.ts +11 -0
- package/src/flow/actions/set_contact_status.ts +11 -0
- package/src/flow/actions/set_run_result.ts +11 -0
- package/src/flow/actions/split_by_expression_example.ts +88 -0
- package/src/flow/actions/start_session.ts +12 -0
- package/src/flow/actions/transfer_airtime.ts +12 -0
- package/src/flow/config.ts +93 -136
- package/src/flow/nodes/execute_actions.ts +5 -0
- package/src/flow/nodes/split_by_airtime.ts +9 -0
- package/src/flow/nodes/split_by_contact_field.ts +7 -0
- package/src/flow/nodes/split_by_expression.ts +7 -0
- package/src/flow/nodes/split_by_groups.ts +7 -0
- package/src/flow/nodes/split_by_random.ts +10 -0
- package/src/flow/nodes/split_by_run_result.ts +7 -0
- package/src/flow/nodes/split_by_scheme.ts +7 -0
- package/src/flow/nodes/split_by_subflow.ts +9 -0
- package/src/flow/nodes/split_by_webhook.ts +19 -0
- package/src/flow/nodes/wait_for_audio.ts +7 -0
- package/src/flow/nodes/wait_for_digits.ts +7 -0
- package/src/flow/nodes/wait_for_image.ts +7 -0
- package/src/flow/nodes/wait_for_location.ts +7 -0
- package/src/flow/nodes/wait_for_menu.ts +7 -0
- package/src/flow/nodes/wait_for_response.ts +7 -0
- package/src/flow/nodes/wait_for_video.ts +7 -0
- package/src/flow/types.ts +352 -0
- package/src/flow/utils.ts +76 -0
- package/src/form/ArrayEditor.ts +240 -0
- package/src/form/BaseListEditor.ts +177 -0
- package/src/{checkbox → form}/Checkbox.ts +24 -5
- package/src/{colorpicker → form}/ColorPicker.ts +2 -2
- package/src/{completion → form}/Completion.ts +9 -3
- package/src/{compose → form}/Compose.ts +7 -7
- package/src/{contactsearch → form}/ContactSearch.ts +6 -6
- package/src/{datepicker → form}/DatePicker.ts +1 -1
- package/src/{FormElement.ts → form/FormElement.ts} +1 -1
- package/src/form/FormField.ts +238 -0
- package/src/{imagepicker → form}/ImagePicker.ts +2 -2
- package/src/form/KeyValueEditor.ts +251 -0
- package/src/{mediapicker → form}/MediaPicker.ts +1 -1
- package/src/{slider → form}/TembaSlider.ts +1 -1
- package/src/{templates → form}/TemplateEditor.ts +2 -2
- package/src/{textinput → form}/TextInput.ts +5 -5
- package/src/{omnibox → form/select}/Omnibox.ts +2 -2
- package/src/{select → form/select}/PopupSelect.ts +1 -1
- package/src/{select → form/select}/Select.ts +207 -152
- package/src/{select → form/select}/UserSelect.ts +1 -1
- package/src/{select → form/select}/WorkspaceSelect.ts +1 -1
- package/src/interfaces.ts +8 -2
- package/src/{dialog → layout}/Dialog.ts +1 -1
- package/src/list/NotificationList.ts +2 -2
- package/src/list/RunList.ts +3 -3
- package/src/list/ShortcutList.ts +1 -1
- package/src/list/TembaMenu.ts +2 -2
- package/src/list/TicketList.ts +1 -1
- package/src/{aliaseditor → live}/AliasEditor.ts +3 -3
- package/src/{contacts → live}/ContactBadges.ts +1 -1
- package/src/{contacts → live}/ContactChat.ts +120 -104
- package/src/{contacts → live}/ContactDetails.ts +1 -1
- package/src/{contacts → live}/ContactFieldEditor.ts +4 -4
- package/src/{contacts → live}/ContactFields.ts +1 -1
- package/src/{contacts → live}/ContactNotepad.ts +1 -1
- package/src/{contacts → live}/ContactPending.ts +1 -1
- package/src/{chart → live}/TembaChart.ts +1 -1
- package/src/store/AppState.ts +75 -29
- package/src/store/Store.ts +1 -1
- package/src/store/flow-definition.d.ts +131 -1
- package/src/{utils/index.ts → utils.ts} +26 -10
- package/src/webchat/WebChat.ts +1 -1
- package/static/api/contacts.json +30 -0
- package/static/api/groups.json +4 -426
- package/static/api/locations.json +24 -0
- package/static/api/media.json +5 -0
- package/static/api/optins.json +16 -0
- package/static/api/orgs.json +13 -0
- package/static/api/topics.json +21 -0
- package/static/api/users.json +26 -0
- package/static/css/temba-components.css +4 -6
- package/svg.js +1 -4
- package/temba-components.ts +2 -2
- package/temba-modules.ts +63 -56
- package/temba-webchat.ts +2 -2
- package/test/ActionHelper.ts +142 -0
- package/test/actions/add_contact_groups.test.ts +89 -0
- package/test/actions/remove_contact_groups.test.ts +265 -0
- package/test/actions/send_email.test.ts +214 -0
- package/test/actions/send_msg.test.ts +130 -0
- package/test/temba-action-editing-integration.test.ts +240 -0
- package/test/temba-alert.test.ts +1 -1
- package/test/temba-appstate-language.test.ts +108 -0
- package/test/temba-charcount.test.ts +1 -1
- package/test/temba-chart.test.ts +1 -1
- package/test/temba-checkbox.test.ts +2 -2
- package/test/temba-color-picker.test.ts +1 -1
- package/test/temba-completion.test.ts +1 -1
- package/test/temba-compose.test.ts +1 -1
- package/test/temba-contact-badges.test.ts +1 -1
- package/test/temba-contact-chat.test.ts +6 -4
- package/test/temba-contact-details.test.ts +1 -1
- package/test/temba-contact-fields.test.ts +1 -1
- package/test/temba-contact-search.test.ts +2 -2
- package/test/temba-date.test.ts +8 -3
- package/test/temba-datepicker.test.ts +1 -1
- package/test/temba-dialog.test.ts +1 -1
- package/test/temba-dropdown.test.ts +1 -1
- package/test/temba-excellent-helpers.test.ts +417 -0
- package/test/temba-field-config.test.ts +152 -0
- package/test/temba-field-manager.test.ts +2 -2
- package/test/temba-flow-editor-node.test.ts +551 -16
- package/test/temba-flow-editor.test.ts +224 -0
- package/test/temba-flow-editor.test.ts.backup +563 -0
- package/test/temba-flow-plumber-connections.test.ts +142 -0
- package/test/temba-flow-plumber.test.ts +83 -120
- package/test/temba-flow-self-routing.test.ts +215 -0
- package/test/temba-formfield.test.ts +1 -1
- package/test/temba-icon.test.ts +1 -1
- package/test/temba-integration-markdown.test.ts +1 -1
- package/test/temba-label.test.ts +1 -1
- package/test/temba-lightbox.test.ts +1 -1
- package/test/temba-markdown.test.ts +162 -0
- package/test/temba-menu.test.ts +1 -1
- package/test/temba-modax.test.ts +2 -2
- package/test/temba-modules.test.ts +56 -0
- package/test/temba-node-editor.test.ts +353 -0
- package/test/temba-omnibox.test.ts +1 -1
- package/test/temba-options.test.ts +1 -1
- package/test/temba-range-picker.test.ts +17 -2
- package/test/temba-rapid-element.test.ts +341 -0
- package/test/temba-resize-element.test.ts +104 -0
- package/test/temba-select.test.ts +129 -2
- package/test/temba-slider.test.ts +1 -1
- package/test/temba-sticky-note.test.ts +281 -0
- package/test/temba-template-editor.test.ts +1 -1
- package/test/temba-textinput.test.ts +1 -1
- package/test/temba-tip.test.ts +1 -1
- package/test/temba-toast.test.ts +1 -1
- package/test/temba-utils-index.test.ts +1 -1
- package/test/temba-utils-index.test.ts.backup +1737 -0
- package/test/temba-utils-uuid.test.ts +48 -0
- package/test/temba-webchat.test.ts +30 -12
- package/test/utils.test.ts +5 -9
- package/test-assets/contacts/history.json +11 -33
- package/web-dev-server.config.mjs +35 -1
- package/demo/sticky-note-demo.html +0 -155
- package/out-tsc/src/FormElement.js.map +0 -1
- package/out-tsc/src/alert/Alert.js.map +0 -1
- package/out-tsc/src/aliaseditor/AliasEditor.js.map +0 -1
- package/out-tsc/src/anchor/Anchor.js.map +0 -1
- package/out-tsc/src/button/Button.js.map +0 -1
- package/out-tsc/src/charcount/CharCount.js.map +0 -1
- package/out-tsc/src/charcount/helpers.js +0 -159
- package/out-tsc/src/charcount/helpers.js.map +0 -1
- package/out-tsc/src/chart/TembaChart.js.map +0 -1
- package/out-tsc/src/chat/Chat.js.map +0 -1
- package/out-tsc/src/checkbox/Checkbox.js.map +0 -1
- package/out-tsc/src/colorpicker/ColorPicker.js.map +0 -1
- package/out-tsc/src/completion/Completion.js.map +0 -1
- package/out-tsc/src/completion/ExcellentParser.js.map +0 -1
- package/out-tsc/src/completion/helpers.js.map +0 -1
- package/out-tsc/src/compose/Compose.js.map +0 -1
- package/out-tsc/src/contacts/ContactBadges.js.map +0 -1
- package/out-tsc/src/contacts/ContactChat.js.map +0 -1
- package/out-tsc/src/contacts/ContactDetails.js.map +0 -1
- package/out-tsc/src/contacts/ContactFieldEditor.js.map +0 -1
- package/out-tsc/src/contacts/ContactFields.js.map +0 -1
- package/out-tsc/src/contacts/ContactName.js.map +0 -1
- package/out-tsc/src/contacts/ContactNameFetch.js.map +0 -1
- package/out-tsc/src/contacts/ContactPending.js.map +0 -1
- package/out-tsc/src/contacts/ContactStoreElement.js.map +0 -1
- package/out-tsc/src/contacts/ContactUrn.js.map +0 -1
- package/out-tsc/src/contacts/events.js +0 -65
- package/out-tsc/src/contacts/events.js.map +0 -1
- package/out-tsc/src/contacts/helpers.js +0 -77
- package/out-tsc/src/contacts/helpers.js.map +0 -1
- package/out-tsc/src/contactsearch/ContactSearch.js.map +0 -1
- package/out-tsc/src/date/TembaDate.js.map +0 -1
- package/out-tsc/src/datepicker/DatePicker.js.map +0 -1
- package/out-tsc/src/datepicker/RangePicker.js.map +0 -1
- package/out-tsc/src/dialog/Dialog.js.map +0 -1
- package/out-tsc/src/dropdown/Dropdown.js.map +0 -1
- package/out-tsc/src/fields/FieldManager.js.map +0 -1
- package/out-tsc/src/flow/EditorNode.js +0 -291
- package/out-tsc/src/flow/EditorNode.js.map +0 -1
- package/out-tsc/src/flow/render.js +0 -41
- package/out-tsc/src/flow/render.js.map +0 -1
- package/out-tsc/src/formfield/FormField.js +0 -144
- package/out-tsc/src/formfield/FormField.js.map +0 -1
- package/out-tsc/src/imagepicker/CroppieCSS.js.map +0 -1
- package/out-tsc/src/imagepicker/ImagePicker.js.map +0 -1
- package/out-tsc/src/label/Label.js.map +0 -1
- package/out-tsc/src/leafletmap/LeafletMap.js.map +0 -1
- package/out-tsc/src/leafletmap/helpers.js +0 -17
- package/out-tsc/src/leafletmap/helpers.js.map +0 -1
- package/out-tsc/src/lightbox/Lightbox.js.map +0 -1
- package/out-tsc/src/mask/Mask.js.map +0 -1
- package/out-tsc/src/mediapicker/MediaPicker.js.map +0 -1
- package/out-tsc/src/omnibox/Omnibox.js.map +0 -1
- package/out-tsc/src/options/helpers.js +0 -28
- package/out-tsc/src/options/helpers.js.map +0 -1
- package/out-tsc/src/progress/ProgressBar.js.map +0 -1
- package/out-tsc/src/progress/StartProgress.js.map +0 -1
- package/out-tsc/src/resizer/Resizer.js.map +0 -1
- package/out-tsc/src/select/PopupSelect.js.map +0 -1
- package/out-tsc/src/select/Select.js.map +0 -1
- package/out-tsc/src/select/UserSelect.js.map +0 -1
- package/out-tsc/src/select/WorkspaceSelect.js.map +0 -1
- package/out-tsc/src/select/helpers.js +0 -1
- package/out-tsc/src/select/helpers.js.map +0 -1
- package/out-tsc/src/shadowless/Shadowless.js +0 -33
- package/out-tsc/src/shadowless/Shadowless.js.map +0 -1
- package/out-tsc/src/slider/TembaSlider.js.map +0 -1
- package/out-tsc/src/sms/gsmsplitter.js.map +0 -1
- package/out-tsc/src/sms/gsmvalidator.js.map +0 -1
- package/out-tsc/src/sms/index.js.map +0 -1
- package/out-tsc/src/sms/unicodesplitter.js.map +0 -1
- package/out-tsc/src/tabpane/Tab.js.map +0 -1
- package/out-tsc/src/tabpane/TabPane.js.map +0 -1
- package/out-tsc/src/templates/TemplateEditor.js.map +0 -1
- package/out-tsc/src/textinput/TextInput.js.map +0 -1
- package/out-tsc/src/textinput/helpers.js +0 -12
- package/out-tsc/src/textinput/helpers.js.map +0 -1
- package/out-tsc/src/thumbnail/Thumbnail.js.map +0 -1
- package/out-tsc/src/tip/Tip.js.map +0 -1
- package/out-tsc/src/tip/helpers.js +0 -7
- package/out-tsc/src/tip/helpers.js.map +0 -1
- package/out-tsc/src/toast/Toast.js.map +0 -1
- package/out-tsc/src/user/TembaUser.js.map +0 -1
- package/out-tsc/src/utils/index.js.map +0 -1
- package/out-tsc/src/vectoricon/VectorIcon.js.map +0 -1
- package/out-tsc/src/vectoricon/index.js.map +0 -1
- package/out-tsc/test/temba-flow-render.test.js +0 -171
- package/out-tsc/test/temba-flow-render.test.js.map +0 -1
- package/src/charcount/helpers.ts +0 -162
- package/src/contacts/events.ts +0 -210
- package/src/contacts/helpers.ts +0 -103
- package/src/flow/EditorNode.ts +0 -318
- package/src/flow/render.ts +0 -56
- package/src/formfield/FormField.ts +0 -134
- package/src/leafletmap/helpers.ts +0 -18
- package/src/options/helpers.ts +0 -37
- package/src/select/helpers.ts +0 -0
- package/src/shadowless/Shadowless.ts +0 -32
- package/src/textinput/helpers.ts +0 -11
- package/src/tip/helpers.ts +0 -7
- package/test/temba-flow-render.test.ts +0 -220
- /package/out-tsc/src/{alert → display}/Alert.js +0 -0
- /package/out-tsc/src/{anchor → display}/Anchor.js +0 -0
- /package/out-tsc/src/{button → display}/Button.js +0 -0
- /package/out-tsc/src/{chat → display}/Chat.js +0 -0
- /package/out-tsc/src/{contacts → display}/ContactName.js +0 -0
- /package/out-tsc/src/{contacts → display}/ContactUrn.js +0 -0
- /package/out-tsc/src/{dropdown → display}/Dropdown.js +0 -0
- /package/out-tsc/src/{label → display}/Label.js +0 -0
- /package/out-tsc/src/{lightbox → display}/Lightbox.js +0 -0
- /package/out-tsc/src/{loading → display}/Loading.js +0 -0
- /package/out-tsc/src/{options → display}/Options.js +0 -0
- /package/out-tsc/src/{progress → display}/ProgressBar.js +0 -0
- /package/out-tsc/src/{date → display}/TembaDate.js +0 -0
- /package/out-tsc/src/{user → display}/TembaUser.js +0 -0
- /package/out-tsc/src/{thumbnail → display}/Thumbnail.js +0 -0
- /package/out-tsc/src/{toast → display}/Toast.js +0 -0
- /package/out-tsc/src/{sms → display/sms}/gsmsplitter.js +0 -0
- /package/out-tsc/src/{sms → display/sms}/gsmvalidator.js +0 -0
- /package/out-tsc/src/{sms → display/sms}/index.js +0 -0
- /package/out-tsc/src/{sms → display/sms}/unicodesplitter.js +0 -0
- /package/out-tsc/src/{completion → excellent}/ExcellentParser.js +0 -0
- /package/out-tsc/src/{completion → excellent}/helpers.js +0 -0
- /package/out-tsc/src/{imagepicker → form}/CroppieCSS.js +0 -0
- /package/out-tsc/src/{datepicker → form}/RangePicker.js +0 -0
- /package/out-tsc/src/{dialog → layout}/Dialog.js +0 -0
- /package/out-tsc/src/{mask → layout}/Mask.js +0 -0
- /package/out-tsc/src/{dialog → layout}/Modax.js +0 -0
- /package/out-tsc/src/{resizer → layout}/Resizer.js +0 -0
- /package/out-tsc/src/{tabpane → layout}/Tab.js +0 -0
- /package/out-tsc/src/{tabpane → layout}/TabPane.js +0 -0
- /package/out-tsc/src/{contacts → live}/ContactFields.js +0 -0
- /package/out-tsc/src/{contacts → live}/ContactNameFetch.js +0 -0
- /package/out-tsc/src/{contacts → live}/ContactStoreElement.js +0 -0
- /package/out-tsc/src/{fields → live}/FieldManager.js +0 -0
- /package/out-tsc/src/{progress → live}/StartProgress.js +0 -0
- /package/out-tsc/src/{chart → live}/TembaChart.js +0 -0
- /package/src/{vectoricon/index.ts → Icons.ts} +0 -0
- /package/src/{alert → display}/Alert.ts +0 -0
- /package/src/{anchor → display}/Anchor.ts +0 -0
- /package/src/{button → display}/Button.ts +0 -0
- /package/src/{chat → display}/Chat.ts +0 -0
- /package/src/{contacts → display}/ContactName.ts +0 -0
- /package/src/{contacts → display}/ContactUrn.ts +0 -0
- /package/src/{dropdown → display}/Dropdown.ts +0 -0
- /package/src/{label → display}/Label.ts +0 -0
- /package/src/{lightbox → display}/Lightbox.ts +0 -0
- /package/src/{loading → display}/Loading.ts +0 -0
- /package/src/{options → display}/Options.ts +0 -0
- /package/src/{progress → display}/ProgressBar.ts +0 -0
- /package/src/{date → display}/TembaDate.ts +0 -0
- /package/src/{user → display}/TembaUser.ts +0 -0
- /package/src/{toast → display}/Toast.ts +0 -0
- /package/src/{sms → display/sms}/gsmsplitter.ts +0 -0
- /package/src/{sms → display/sms}/gsmvalidator.ts +0 -0
- /package/src/{sms → display/sms}/index.ts +0 -0
- /package/src/{sms → display/sms}/unicodesplitter.ts +0 -0
- /package/src/{completion → excellent}/ExcellentParser.ts +0 -0
- /package/src/{completion → excellent}/helpers.ts +0 -0
- /package/src/{imagepicker → form}/CroppieCSS.ts +0 -0
- /package/src/{datepicker → form}/RangePicker.ts +0 -0
- /package/src/{mask → layout}/Mask.ts +0 -0
- /package/src/{dialog → layout}/Modax.ts +0 -0
- /package/src/{resizer → layout}/Resizer.ts +0 -0
- /package/src/{tabpane → layout}/Tab.ts +0 -0
- /package/src/{tabpane → layout}/TabPane.ts +0 -0
- /package/src/{contacts → live}/ContactNameFetch.ts +0 -0
- /package/src/{contacts → live}/ContactStoreElement.ts +0 -0
- /package/src/{fields → live}/FieldManager.ts +0 -0
- /package/src/{progress → live}/StartProgress.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, CallResthook } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const call_resthook: ActionConfig = {
|
|
6
|
+
name: 'Call Resthook',
|
|
7
|
+
color: COLORS.call,
|
|
8
|
+
render: (_node: Node, _action: CallResthook) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Call Resthook</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, CallWebhook } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const call_webhook: ActionConfig = {
|
|
6
|
+
name: 'Call Webhook',
|
|
7
|
+
color: COLORS.call,
|
|
8
|
+
render: (_node: Node, action: CallWebhook) => {
|
|
9
|
+
return html`<div
|
|
10
|
+
style="word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;"
|
|
11
|
+
>
|
|
12
|
+
${action.url}
|
|
13
|
+
</div>`;
|
|
14
|
+
},
|
|
15
|
+
evaluated: ['url', 'headers', 'body'], // keep for backward compatibility
|
|
16
|
+
form: {
|
|
17
|
+
method: {
|
|
18
|
+
type: 'select',
|
|
19
|
+
required: true,
|
|
20
|
+
options: ['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'PATCH'],
|
|
21
|
+
maxWidth: '120px',
|
|
22
|
+
searchable: true
|
|
23
|
+
},
|
|
24
|
+
url: {
|
|
25
|
+
type: 'text',
|
|
26
|
+
required: true,
|
|
27
|
+
evaluated: true,
|
|
28
|
+
placeholder: 'https://example.com/webhook'
|
|
29
|
+
},
|
|
30
|
+
headers: {
|
|
31
|
+
type: 'key-value',
|
|
32
|
+
sortable: true,
|
|
33
|
+
keyPlaceholder: 'Header name',
|
|
34
|
+
valuePlaceholder: 'Header value',
|
|
35
|
+
minRows: 0
|
|
36
|
+
},
|
|
37
|
+
body: {
|
|
38
|
+
type: 'textarea',
|
|
39
|
+
evaluated: true,
|
|
40
|
+
placeholder: 'Request body content (JSON, XML, etc.)',
|
|
41
|
+
minHeight: 200,
|
|
42
|
+
dependsOn: ['method'],
|
|
43
|
+
computeValue: (
|
|
44
|
+
values: Record<string, any>,
|
|
45
|
+
currentValue: any,
|
|
46
|
+
originalValues?: Record<string, any>
|
|
47
|
+
) => {
|
|
48
|
+
// Check if method is POST (handle both string and select object formats)
|
|
49
|
+
const method =
|
|
50
|
+
Array.isArray(values.method) && values.method.length > 0
|
|
51
|
+
? values.method[0].value || values.method[0].name
|
|
52
|
+
: values.method;
|
|
53
|
+
|
|
54
|
+
const defaultTemplate = `@(json(object(
|
|
55
|
+
"contact", object(
|
|
56
|
+
"uuid", contact.uuid,
|
|
57
|
+
"name", contact.name,
|
|
58
|
+
"urn", contact.urn
|
|
59
|
+
),
|
|
60
|
+
"flow", object(
|
|
61
|
+
"uuid", run.flow.uuid,
|
|
62
|
+
"name", run.flow.name
|
|
63
|
+
),
|
|
64
|
+
"results", foreach_value(results, extract_object, "value", "category")
|
|
65
|
+
)))`;
|
|
66
|
+
|
|
67
|
+
if (method === 'POST') {
|
|
68
|
+
// For POST, provide the template if body is empty or was never set by user
|
|
69
|
+
if (!currentValue || currentValue.trim() === '') {
|
|
70
|
+
return defaultTemplate;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
// For non-POST methods, clear the body if it was auto-generated or empty
|
|
74
|
+
// Check if the original body was empty (user never specified a body)
|
|
75
|
+
const originalBody = originalValues?.body || '';
|
|
76
|
+
const isOriginallyEmpty = !originalBody || originalBody.trim() === '';
|
|
77
|
+
|
|
78
|
+
// Clear if: originally empty, contains default template, or is currently empty
|
|
79
|
+
if (
|
|
80
|
+
isOriginallyEmpty ||
|
|
81
|
+
!currentValue ||
|
|
82
|
+
currentValue.trim() === '' ||
|
|
83
|
+
currentValue.trim() === defaultTemplate.trim()
|
|
84
|
+
) {
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return currentValue; // Keep existing value if user has customized it
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
layout: [
|
|
94
|
+
// Row with method and URL side by side
|
|
95
|
+
{ type: 'row', items: ['method', 'url'] },
|
|
96
|
+
// Advanced group with nested layouts
|
|
97
|
+
{
|
|
98
|
+
type: 'group',
|
|
99
|
+
label: 'Headers',
|
|
100
|
+
items: ['headers'],
|
|
101
|
+
collapsible: true,
|
|
102
|
+
collapsed: true,
|
|
103
|
+
helpText: 'Configure authentication or custom headers'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'group',
|
|
107
|
+
label: 'Body',
|
|
108
|
+
items: ['body'],
|
|
109
|
+
collapsible: true,
|
|
110
|
+
collapsed: true,
|
|
111
|
+
helpText: 'Configure the request payload'
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
toFormData: (action: CallWebhook) => {
|
|
115
|
+
return {
|
|
116
|
+
uuid: action.uuid,
|
|
117
|
+
url: action.url || '',
|
|
118
|
+
method: [{ value: action.method, name: action.method }],
|
|
119
|
+
headers: action.headers || [],
|
|
120
|
+
body: action.body || ''
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
fromFormData: (data: Record<string, any>) => {
|
|
124
|
+
return {
|
|
125
|
+
uuid: data.uuid,
|
|
126
|
+
type: 'call_webhook',
|
|
127
|
+
url: data.url,
|
|
128
|
+
method: data.method[0].value,
|
|
129
|
+
headers: data.headers || [],
|
|
130
|
+
body: data.body || ''
|
|
131
|
+
} as CallWebhook;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, EnterFlow } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const enter_flow: ActionConfig = {
|
|
6
|
+
name: 'Enter a Flow',
|
|
7
|
+
color: COLORS.execute,
|
|
8
|
+
render: (_node: Node, action: EnterFlow) => {
|
|
9
|
+
return html`<div
|
|
10
|
+
style="word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;"
|
|
11
|
+
>
|
|
12
|
+
Enter <b>${action.flow.name}</b>
|
|
13
|
+
</div>`;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, OpenTicket } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const open_ticket: ActionConfig = {
|
|
6
|
+
name: 'Open Ticket',
|
|
7
|
+
color: COLORS.create,
|
|
8
|
+
render: (_node: Node, _action: OpenTicket) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Open Ticket</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, PlayAudio } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const play_audio: ActionConfig = {
|
|
6
|
+
name: 'Play Audio',
|
|
7
|
+
color: COLORS.send,
|
|
8
|
+
render: (_node: Node, _action: PlayAudio) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Play Audio</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS, ValidationResult } from '../types';
|
|
3
|
+
import { Node, RemoveFromGroup } from '../../store/flow-definition';
|
|
4
|
+
import { renderNamedObjects } from '../utils';
|
|
5
|
+
|
|
6
|
+
export const remove_contact_groups: ActionConfig = {
|
|
7
|
+
name: 'Remove from Group',
|
|
8
|
+
color: COLORS.remove,
|
|
9
|
+
render: (_node: Node, action: RemoveFromGroup) => {
|
|
10
|
+
if (action.all_groups) {
|
|
11
|
+
return html`<div>Remove from all groups</div>`;
|
|
12
|
+
}
|
|
13
|
+
return html`<div>${renderNamedObjects(action.groups, 'group')}</div>`;
|
|
14
|
+
},
|
|
15
|
+
toFormData: (action: RemoveFromGroup) => {
|
|
16
|
+
return {
|
|
17
|
+
uuid: action.uuid,
|
|
18
|
+
all_groups: action.all_groups || false,
|
|
19
|
+
groups: action.groups || []
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
form: {
|
|
23
|
+
groups: {
|
|
24
|
+
type: 'select',
|
|
25
|
+
label: 'Groups',
|
|
26
|
+
helpText: 'Select the groups to remove the contact from',
|
|
27
|
+
options: [],
|
|
28
|
+
multi: true,
|
|
29
|
+
searchable: true,
|
|
30
|
+
endpoint: '/api/v2/groups.json',
|
|
31
|
+
valueKey: 'uuid',
|
|
32
|
+
nameKey: 'name',
|
|
33
|
+
placeholder: 'Search for groups...',
|
|
34
|
+
conditions: {
|
|
35
|
+
visible: (formData) => !formData.all_groups
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
all_groups: {
|
|
39
|
+
type: 'checkbox',
|
|
40
|
+
label: 'Remove from All Groups',
|
|
41
|
+
helpText:
|
|
42
|
+
'Check this to remove the contact from all groups instead of specific ones'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
validate: (action: RemoveFromGroup): ValidationResult => {
|
|
46
|
+
const errors: { [key: string]: string } = {};
|
|
47
|
+
|
|
48
|
+
if (!action.all_groups && (!action.groups || action.groups.length === 0)) {
|
|
49
|
+
errors.groups =
|
|
50
|
+
'At least one group must be selected or check "Remove from All Groups"';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
valid: Object.keys(errors).length === 0,
|
|
55
|
+
errors
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
fromFormData: (formData: any): RemoveFromGroup => {
|
|
59
|
+
return {
|
|
60
|
+
uuid: formData.uuid,
|
|
61
|
+
type: 'remove_contact_groups',
|
|
62
|
+
groups: formData.all_groups ? [] : formData.groups || [],
|
|
63
|
+
all_groups: formData.all_groups || false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, RequestOptin } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const request_optin: ActionConfig = {
|
|
6
|
+
name: 'Request Opt-in',
|
|
7
|
+
color: COLORS.send,
|
|
8
|
+
render: (_node: Node, _action: RequestOptin) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Request Opt-in</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SayMsg } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const say_msg: ActionConfig = {
|
|
6
|
+
name: 'Say Message',
|
|
7
|
+
color: COLORS.send,
|
|
8
|
+
render: (_node: Node, _action: SayMsg) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Say Message</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SendBroadcast } from '../../store/flow-definition';
|
|
4
|
+
import { renderNamedObjects } from '../utils';
|
|
5
|
+
|
|
6
|
+
export const send_broadcast: ActionConfig = {
|
|
7
|
+
name: 'Send Broadcast',
|
|
8
|
+
color: COLORS.broadcast,
|
|
9
|
+
render: (_node: Node, action: SendBroadcast) => {
|
|
10
|
+
const hasGroups = action.groups && action.groups.length > 0;
|
|
11
|
+
const hasContacts = action.contacts && action.contacts.length > 0;
|
|
12
|
+
|
|
13
|
+
return html`<div>
|
|
14
|
+
<div
|
|
15
|
+
style="word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; margin-bottom: 0.5em"
|
|
16
|
+
>
|
|
17
|
+
${action.text}
|
|
18
|
+
</div>
|
|
19
|
+
${hasGroups
|
|
20
|
+
? html`<div style="margin-bottom: 0.25em">
|
|
21
|
+
<div style="font-weight: bold; margin-bottom: 0.25em">Groups:</div>
|
|
22
|
+
${renderNamedObjects(action.groups, 'group')}
|
|
23
|
+
</div>`
|
|
24
|
+
: null}
|
|
25
|
+
${hasContacts
|
|
26
|
+
? html`<div>
|
|
27
|
+
<div style="font-weight: bold; margin-bottom: 0.25em">
|
|
28
|
+
Contacts:
|
|
29
|
+
</div>
|
|
30
|
+
${renderNamedObjects(action.contacts, 'contact')}
|
|
31
|
+
</div>`
|
|
32
|
+
: null}
|
|
33
|
+
</div>`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS, ValidationResult } from '../types';
|
|
3
|
+
import { Node, SendEmail } from '../../store/flow-definition';
|
|
4
|
+
import { renderStringList } from '../utils';
|
|
5
|
+
import { Icon } from '../../Icons';
|
|
6
|
+
|
|
7
|
+
export const send_email: ActionConfig = {
|
|
8
|
+
name: 'Send Email',
|
|
9
|
+
color: COLORS.send,
|
|
10
|
+
render: (_node: Node, action: SendEmail) => {
|
|
11
|
+
return html`<div>
|
|
12
|
+
<div>${renderStringList(action.addresses, Icon.email)}</div>
|
|
13
|
+
<div style="margin-top: 0.5em">
|
|
14
|
+
<div
|
|
15
|
+
style="word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;"
|
|
16
|
+
>
|
|
17
|
+
${action.subject}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>`;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
form: {
|
|
24
|
+
addresses: {
|
|
25
|
+
type: 'select',
|
|
26
|
+
label: 'Recipients',
|
|
27
|
+
options: [],
|
|
28
|
+
multi: true,
|
|
29
|
+
searchable: true,
|
|
30
|
+
placeholder: 'Search for contacts...',
|
|
31
|
+
emails: true
|
|
32
|
+
},
|
|
33
|
+
subject: {
|
|
34
|
+
type: 'text',
|
|
35
|
+
label: 'Subject',
|
|
36
|
+
required: true,
|
|
37
|
+
placeholder: 'Enter email subject',
|
|
38
|
+
maxLength: 255
|
|
39
|
+
},
|
|
40
|
+
body: {
|
|
41
|
+
type: 'textarea',
|
|
42
|
+
required: true,
|
|
43
|
+
evaluated: true,
|
|
44
|
+
rows: 4,
|
|
45
|
+
minHeight: 75
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
validate: (action: SendEmail): ValidationResult => {
|
|
49
|
+
const errors: { [key: string]: string } = {};
|
|
50
|
+
|
|
51
|
+
if (!action.addresses || action.addresses.length === 0) {
|
|
52
|
+
errors.addresses = 'At least one recipient email address is required';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
valid: Object.keys(errors).length === 0,
|
|
57
|
+
errors
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
3
|
+
import { ActionConfig, COLORS, ValidationResult } from '../types';
|
|
4
|
+
import { Node, SendMsg } from '../../store/flow-definition';
|
|
5
|
+
|
|
6
|
+
export const send_msg: ActionConfig = {
|
|
7
|
+
name: 'Send Message',
|
|
8
|
+
color: COLORS.send,
|
|
9
|
+
render: (_node: Node, action: SendMsg) => {
|
|
10
|
+
const text = action.text.replace(/\n/g, '<br>');
|
|
11
|
+
return html`
|
|
12
|
+
${unsafeHTML(text)}
|
|
13
|
+
${action.quick_replies?.length > 0
|
|
14
|
+
? html`<div class="quick-replies">
|
|
15
|
+
${action.quick_replies.map((reply) => {
|
|
16
|
+
return html`<div class="quick-reply">${reply}</div>`;
|
|
17
|
+
})}
|
|
18
|
+
</div>`
|
|
19
|
+
: null}
|
|
20
|
+
`;
|
|
21
|
+
},
|
|
22
|
+
form: {
|
|
23
|
+
text: {
|
|
24
|
+
type: 'textarea',
|
|
25
|
+
label: 'Message Text',
|
|
26
|
+
helpText:
|
|
27
|
+
'Enter the message to send. You can use expressions like @contact.name',
|
|
28
|
+
required: true,
|
|
29
|
+
evaluated: true,
|
|
30
|
+
rows: 5,
|
|
31
|
+
minHeight: 75
|
|
32
|
+
},
|
|
33
|
+
quick_replies: {
|
|
34
|
+
type: 'select',
|
|
35
|
+
label: 'Quick Replies',
|
|
36
|
+
helpText: 'Add quick reply options for this message',
|
|
37
|
+
options: [],
|
|
38
|
+
multi: true,
|
|
39
|
+
tags: true,
|
|
40
|
+
searchable: true,
|
|
41
|
+
placeholder: 'Add quick replies...',
|
|
42
|
+
maxItems: 10,
|
|
43
|
+
evaluated: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
validate: (action: SendMsg): ValidationResult => {
|
|
47
|
+
const errors: { [key: string]: string } = {};
|
|
48
|
+
|
|
49
|
+
if (!action.text || action.text.trim() === '') {
|
|
50
|
+
errors.text = 'Message text is required';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
valid: Object.keys(errors).length === 0,
|
|
55
|
+
errors
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetContactChannel } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_contact_channel: ActionConfig = {
|
|
6
|
+
name: 'Update Contact Channel',
|
|
7
|
+
color: COLORS.update,
|
|
8
|
+
render: (_node: Node, action: SetContactChannel) => {
|
|
9
|
+
return html`<div>
|
|
10
|
+
Set contact channel to <b>${action.channel.name}</b>
|
|
11
|
+
</div>`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetContactField } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_contact_field: ActionConfig = {
|
|
6
|
+
name: 'Update Contact Field',
|
|
7
|
+
color: COLORS.update,
|
|
8
|
+
render: (_node: Node, action: SetContactField) => {
|
|
9
|
+
return html`<div>
|
|
10
|
+
Set <b>${action.field.name}</b> to <b>${action.value}</b>
|
|
11
|
+
</div>`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetContactLanguage } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_contact_language: ActionConfig = {
|
|
6
|
+
name: 'Update Contact Language',
|
|
7
|
+
color: COLORS.update,
|
|
8
|
+
render: (_node: Node, action: SetContactLanguage) => {
|
|
9
|
+
return html`<div>Set contact language to <b>${action.language}</b></div>`;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetContactName } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_contact_name: ActionConfig = {
|
|
6
|
+
name: 'Update Contact',
|
|
7
|
+
color: COLORS.update,
|
|
8
|
+
render: (_node: Node, action: SetContactName) => {
|
|
9
|
+
return html`<div>Set contact name to <b>${action.name}</b></div>`;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetContactStatus } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_contact_status: ActionConfig = {
|
|
6
|
+
name: 'Update Contact Status',
|
|
7
|
+
color: COLORS.update,
|
|
8
|
+
render: (_node: Node, action: SetContactStatus) => {
|
|
9
|
+
return html`<div>Set contact status to <b>${action.status}</b></div>`;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, SetRunResult } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const set_run_result: ActionConfig = {
|
|
6
|
+
name: 'Save Flow Result',
|
|
7
|
+
color: COLORS.save,
|
|
8
|
+
render: (_node: Node, action: SetRunResult) => {
|
|
9
|
+
return html`<div>Save ${action.value} as <b>${action.name}</b></div>`;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
|
|
4
|
+
// utility function to generate category from operand
|
|
5
|
+
const generateCategoryFromOperand = (operand: string): string => {
|
|
6
|
+
if (!operand) return '';
|
|
7
|
+
|
|
8
|
+
// clean up the operand to make a reasonable category name
|
|
9
|
+
return operand
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replace(/[^a-z0-9\s]/g, '') // remove special chars
|
|
12
|
+
.replace(/\s+/g, '_') // replace spaces with underscores
|
|
13
|
+
.slice(0, 20); // limit length
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const split_by_expression: ActionConfig = {
|
|
17
|
+
name: 'Split by Expression',
|
|
18
|
+
color: COLORS.split,
|
|
19
|
+
form: {
|
|
20
|
+
operand: {
|
|
21
|
+
type: 'text',
|
|
22
|
+
label: 'Split by',
|
|
23
|
+
required: true,
|
|
24
|
+
evaluated: true,
|
|
25
|
+
placeholder: 'Enter expression to evaluate'
|
|
26
|
+
},
|
|
27
|
+
rules: {
|
|
28
|
+
type: 'array',
|
|
29
|
+
label: 'Rules',
|
|
30
|
+
sortable: true,
|
|
31
|
+
minItems: 1,
|
|
32
|
+
itemLabel: 'Rule',
|
|
33
|
+
itemConfig: {
|
|
34
|
+
operator: {
|
|
35
|
+
type: 'select',
|
|
36
|
+
label: 'Operator',
|
|
37
|
+
required: true,
|
|
38
|
+
options: [
|
|
39
|
+
{ value: 'contains', label: 'contains' },
|
|
40
|
+
{ value: 'equals', label: 'equals' },
|
|
41
|
+
{ value: 'starts_with', label: 'starts with' },
|
|
42
|
+
{ value: 'regex', label: 'regex' }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
operand: {
|
|
46
|
+
type: 'text',
|
|
47
|
+
label: 'Value',
|
|
48
|
+
required: true,
|
|
49
|
+
evaluated: true,
|
|
50
|
+
placeholder: 'Value to compare against'
|
|
51
|
+
},
|
|
52
|
+
category: {
|
|
53
|
+
type: 'text',
|
|
54
|
+
label: 'Category',
|
|
55
|
+
required: true,
|
|
56
|
+
placeholder: 'Category name for this rule'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
// handle changes at the item level
|
|
60
|
+
onItemChange: (
|
|
61
|
+
itemIndex: number,
|
|
62
|
+
field: string,
|
|
63
|
+
value: any,
|
|
64
|
+
allItems: any[]
|
|
65
|
+
) => {
|
|
66
|
+
const updatedItems = [...allItems];
|
|
67
|
+
const item = { ...updatedItems[itemIndex] };
|
|
68
|
+
|
|
69
|
+
// update the changed field
|
|
70
|
+
item[field] = value;
|
|
71
|
+
|
|
72
|
+
// if operand changed and category is empty, auto-generate category
|
|
73
|
+
if (
|
|
74
|
+
field === 'operand' &&
|
|
75
|
+
(!item.category || item.category.trim() === '')
|
|
76
|
+
) {
|
|
77
|
+
item.category = generateCategoryFromOperand(value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
updatedItems[itemIndex] = item;
|
|
81
|
+
return updatedItems;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
render: (_node: any, action: any) => {
|
|
86
|
+
return html`<div>${action.operand || 'Split by expression'}</div>`;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, StartSession } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const start_session: ActionConfig = {
|
|
6
|
+
name: 'Start Session',
|
|
7
|
+
color: COLORS.execute,
|
|
8
|
+
render: (_node: Node, _action: StartSession) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Start Session</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
import { ActionConfig, COLORS } from '../types';
|
|
3
|
+
import { Node, TransferAirtime } from '../../store/flow-definition';
|
|
4
|
+
|
|
5
|
+
export const transfer_airtime: ActionConfig = {
|
|
6
|
+
name: 'Transfer Airtime',
|
|
7
|
+
color: COLORS.send,
|
|
8
|
+
render: (_node: Node, _action: TransferAirtime) => {
|
|
9
|
+
// This will need to be implemented based on the actual render logic
|
|
10
|
+
return html`<div>Transfer Airtime</div>`;
|
|
11
|
+
}
|
|
12
|
+
};
|