@nyaruka/temba-components 0.129.1 → 0.129.3
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/build.yml +6 -5
- package/.github/workflows/coverage.yml +80 -0
- package/CHANGELOG.md +32 -0
- package/README.md +6 -0
- package/check-coverage.js +133 -0
- package/demo/components/alert/example.html +71 -0
- package/demo/components/button/example.html +167 -0
- package/demo/{chart → components/chart}/example.html +3 -3
- package/demo/components/chart/horizontal-demo.html +160 -0
- package/demo/components/checkbox/example.html +68 -0
- package/demo/components/compose/example.html +69 -0
- package/demo/components/datepicker/example.html +3 -3
- package/demo/components/datepicker/range-picker-demo.html +2 -2
- package/demo/{dialog → components/dialog}/example.html +3 -3
- package/demo/components/dropdown/example.html +95 -0
- package/demo/{flow → components/flow}/example.html +1 -1
- package/demo/{misc → components/misc}/example.html +3 -3
- package/demo/components/progress/example.html +62 -0
- package/demo/components/select/drag-and-drop.html +162 -0
- package/demo/components/select/example.html +76 -0
- package/demo/components/select/multi.html +72 -0
- package/demo/components/slider/example.html +55 -0
- package/demo/{sortable-list → components/sortable-list}/example.html +3 -3
- package/demo/components/tabs/example.html +91 -0
- package/demo/{textinput → components/textinput}/completion.html +3 -3
- package/demo/components/textinput/example.html +141 -0
- package/demo/{webchat → components/webchat}/example.html +3 -3
- package/demo/data/flows/sample-flow.json +107 -100
- package/demo/index.html +21 -21
- package/demo/static/css/styles.css +253 -0
- package/demo/sticky-note-demo.html +88 -85
- package/demo/styles.css +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 +2 -11
- 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 +893 -476
- package/dist/temba-components.js.map +1 -1
- 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/Editor.js +533 -140
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/EditorNode.js +287 -20
- package/out-tsc/src/flow/EditorNode.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +154 -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/config.js +88 -18
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/render.js +327 -10
- package/out-tsc/src/flow/render.js.map +1 -1
- package/out-tsc/src/{checkbox → form}/Checkbox.js +2 -2
- 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 +2 -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.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/{mediapicker → form}/MediaPicker.js +1 -1
- package/out-tsc/src/form/MediaPicker.js.map +1 -0
- package/out-tsc/src/{datepicker → form}/RangePicker.js +3 -2
- 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 +86 -87
- 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 +1 -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 +79 -3
- 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/{chart → live}/TembaChart.js +5 -1
- package/out-tsc/src/live/TembaChart.js.map +1 -0
- 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 +2 -11
- 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/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 +54 -54
- 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/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.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-manager.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-node.test.js +414 -1
- 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-render.test.js +624 -1
- package/out-tsc/test/temba-flow-render.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-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 +2 -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/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/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/{contacts/events.ts → events.ts} +1 -64
- package/src/flow/Editor.ts +655 -165
- package/src/flow/EditorNode.ts +337 -22
- package/src/flow/Plumber.ts +186 -79
- package/src/flow/StickyNote.ts +165 -9
- package/src/flow/config.ts +114 -18
- package/src/flow/render.ts +398 -11
- package/src/{checkbox → form}/Checkbox.ts +2 -2
- package/src/{colorpicker → form}/ColorPicker.ts +2 -2
- package/src/{completion → form}/Completion.ts +3 -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/{imagepicker → form}/ImagePicker.ts +2 -2
- package/src/{mediapicker → form}/MediaPicker.ts +1 -1
- package/src/{datepicker → form}/RangePicker.ts +3 -2
- 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 +124 -126
- package/src/{select → form/select}/UserSelect.ts +1 -1
- package/src/{select → form/select}/WorkspaceSelect.ts +1 -1
- package/src/interfaces.ts +2 -1
- 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 +118 -8
- 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 +5 -2
- package/src/locales/es.ts +13 -18
- package/src/locales/fr.ts +13 -18
- package/src/locales/locale-codes.ts +2 -11
- package/src/locales/pt.ts +13 -18
- package/src/store/AppState.ts +75 -29
- package/src/store/Store.ts +1 -1
- package/src/store/flow-definition.d.ts +125 -0
- package/src/{utils/index.ts → utils.ts} +26 -10
- package/src/webchat/WebChat.ts +1 -1
- package/static/css/temba-components.css +1 -0
- package/svg.js +1 -4
- package/temba-components.ts +2 -2
- package/temba-modules.ts +54 -54
- package/temba-webchat.ts +2 -2
- 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 +1 -1
- 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-manager.test.ts +2 -2
- package/test/temba-flow-editor-node.test.ts +536 -1
- 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-render.test.ts +787 -4
- 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-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 +2 -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/web-dev-server.config.mjs +1 -1
- package/demo/alert/example.html +0 -65
- package/demo/button/example.html +0 -71
- package/demo/chart/horizontal-demo.html +0 -81
- package/demo/checkbox/example.html +0 -72
- package/demo/compose/example.html +0 -72
- package/demo/dropdown/example.html +0 -99
- package/demo/progress/example.html +0 -59
- package/demo/select/drag-and-drop.html +0 -142
- package/demo/select/example.html +0 -82
- package/demo/select/multi.html +0 -73
- package/demo/slider/example.html +0 -59
- package/demo/tabs/example.html +0 -91
- package/demo/textinput/example.html +0 -61
- 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/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/src/charcount/helpers.ts +0 -162
- package/src/contacts/helpers.ts +0 -103
- 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/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/{formfield → form}/FormField.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/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/{formfield → form}/FormField.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
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
2
2
|
import { html, TemplateResult } from 'lit-html';
|
|
3
|
-
import { Button } from '
|
|
4
|
-
import { Dialog } from '
|
|
5
|
-
import {
|
|
6
|
-
Attachment,
|
|
7
|
-
ContactField,
|
|
8
|
-
Shortcut,
|
|
9
|
-
Ticket,
|
|
10
|
-
User
|
|
11
|
-
} from '../interfaces';
|
|
3
|
+
import { Button } from './display/Button';
|
|
4
|
+
import { Dialog } from './layout/Dialog';
|
|
5
|
+
import { Attachment, ContactField, Shortcut, Ticket, User } from './interfaces';
|
|
12
6
|
import ColorHash from 'color-hash';
|
|
13
|
-
import { Toast } from '
|
|
7
|
+
import { Toast } from './display/Toast';
|
|
8
|
+
import { v4 as generateUUID } from 'uuid';
|
|
14
9
|
|
|
15
10
|
export const DEFAULT_MEDIA_ENDPOINT = '/api/v2/media.json';
|
|
16
11
|
|
|
@@ -582,6 +577,7 @@ export const isDate = (value: any): boolean => {
|
|
|
582
577
|
if (toString.call(value) === '[object Date]') {
|
|
583
578
|
return true;
|
|
584
579
|
}
|
|
580
|
+
/* c8 ignore next 3 */
|
|
585
581
|
if (typeof value.replace === 'function') {
|
|
586
582
|
value.replace(/^\s+|\s+$/gm, '');
|
|
587
583
|
}
|
|
@@ -916,3 +912,23 @@ export const hashCode = (s) => {
|
|
|
916
912
|
export const showModax = (title: string, endpoint: string) => {
|
|
917
913
|
(window as any).showModax(title, endpoint);
|
|
918
914
|
};
|
|
915
|
+
export const sanitizeUnintendedUnicode = (text: string): string => {
|
|
916
|
+
if (text) {
|
|
917
|
+
return text
|
|
918
|
+
.replace(/[\u2018\u2019]/g, "'") // Smart single quotes
|
|
919
|
+
.replace(/[\u201C\u201D]/g, '"') // Smart double quotes
|
|
920
|
+
.replace(/[\u2013\u2014]/g, '-') // En/em dash
|
|
921
|
+
.replace(/\u2026/g, '...') // Horizontal ellipsis
|
|
922
|
+
.replace(/\u2002/g, ' '); // En space
|
|
923
|
+
}
|
|
924
|
+
return text;
|
|
925
|
+
};
|
|
926
|
+
export const getCenter = (a: DOMRect, b: DOMRect) => {
|
|
927
|
+
return a.left + a.width / 2 - b.width / 2;
|
|
928
|
+
};
|
|
929
|
+
export const getMiddle = (a: DOMRect, b: DOMRect) => {
|
|
930
|
+
return a.top + a.height / 2 - b.height / 2;
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
// Export the UUID function from the uuid package
|
|
934
|
+
export { generateUUID };
|
package/src/webchat/WebChat.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { LitElement, TemplateResult, html, css, PropertyValueMap } from 'lit';
|
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { getCookie, setCookie } from '../utils';
|
|
5
5
|
import { DEFAULT_AVATAR } from './assets';
|
|
6
|
-
import { Chat, ChatEvent, Message, MessageType } from '../
|
|
6
|
+
import { Chat, ChatEvent, Message, MessageType } from '../display/Chat';
|
|
7
7
|
|
|
8
8
|
interface User {
|
|
9
9
|
avatar?: string;
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
/* primary colors, should be dark */
|
|
34
34
|
--color-selection: #f0f6ff;
|
|
35
35
|
|
|
36
|
+
--color-success: #3ca96a;
|
|
36
37
|
|
|
37
38
|
--widget-box-shadow: rgba(-1, -1, 0, .15) 0px 1px 7px 0px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
|
|
38
39
|
--widget-box-shadow-focused: 0 0 0 3px rgba(164, 202, 254, .45);
|
package/svg.js
CHANGED
|
@@ -90,11 +90,8 @@ function modifyFileContent(filePath, regexPattern, groupNumber, replacement) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
async function main() {
|
|
93
|
-
// const OUTPUT_FILE_NAME = cwd + "/static/svg/index.svg";
|
|
94
|
-
//const USAGE_FILE = './src/vectoricon/index.ts';
|
|
95
|
-
|
|
96
93
|
const OUTPUT_FILE_NAME = argv.output || cwd + '/static/svg/index.svg';
|
|
97
|
-
const USAGE_FILE = argv.usage || './src/
|
|
94
|
+
const USAGE_FILE = argv.usage || './src/Icons.ts';
|
|
98
95
|
|
|
99
96
|
let packs = sh.ls(PACK_DIR);
|
|
100
97
|
packs.sort();
|
package/temba-components.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { addCustomElement } from './temba-modules';
|
|
|
3
3
|
|
|
4
4
|
// we import and declare the alias editor seperately since
|
|
5
5
|
// leaflet-map doesn't work in dev mode
|
|
6
|
-
import { AliasEditor } from './src/
|
|
7
|
-
import { LeafletMap } from './src/
|
|
6
|
+
import { AliasEditor } from './src/live/AliasEditor';
|
|
7
|
+
import { LeafletMap } from './src/display/LeafletMap';
|
|
8
8
|
|
|
9
9
|
addCustomElement('leaflet-map', LeafletMap);
|
|
10
10
|
addCustomElement('alias-editor', AliasEditor);
|
package/temba-modules.ts
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { Checkbox } from './src/
|
|
2
|
-
import { TextInput } from './src/
|
|
1
|
+
import { Checkbox } from './src/form/Checkbox';
|
|
2
|
+
import { TextInput } from './src/form/TextInput';
|
|
3
3
|
import { Store } from './src/store/Store';
|
|
4
|
-
import { Select } from './src/select/Select';
|
|
5
|
-
import { Completion } from './src/
|
|
6
|
-
import { Modax } from './src/
|
|
7
|
-
import { Dialog } from './src/
|
|
8
|
-
import { Button } from './src/
|
|
9
|
-
import { FormField } from './src/
|
|
10
|
-
import { Loading } from './src/
|
|
11
|
-
import { CharCount } from './src/
|
|
12
|
-
import { Options } from './src/
|
|
13
|
-
import { ContactChat } from './src/
|
|
4
|
+
import { Select } from './src/form/select/Select';
|
|
5
|
+
import { Completion } from './src/form/Completion';
|
|
6
|
+
import { Modax } from './src/layout/Modax';
|
|
7
|
+
import { Dialog } from './src/layout/Dialog';
|
|
8
|
+
import { Button } from './src/display/Button';
|
|
9
|
+
import { FormField } from './src/form/FormField';
|
|
10
|
+
import { Loading } from './src/display/Loading';
|
|
11
|
+
import { CharCount } from './src/display/CharCount';
|
|
12
|
+
import { Options } from './src/display/Options';
|
|
13
|
+
import { ContactChat } from './src/live/ContactChat';
|
|
14
14
|
import { TicketList } from './src/list/TicketList';
|
|
15
|
-
import { ContactDetails } from './src/
|
|
15
|
+
import { ContactDetails } from './src/live/ContactDetails';
|
|
16
16
|
import { TembaList } from './src/list/TembaList';
|
|
17
|
-
import { ContactSearch } from './src/
|
|
18
|
-
import { VectorIcon } from './src/
|
|
19
|
-
import { Alert } from './src/
|
|
20
|
-
import { Omnibox } from './src/
|
|
21
|
-
import { Tip } from './src/
|
|
17
|
+
import { ContactSearch } from './src/form/ContactSearch';
|
|
18
|
+
import { VectorIcon } from './src/display/Icon';
|
|
19
|
+
import { Alert } from './src/display/Alert';
|
|
20
|
+
import { Omnibox } from './src/form/select/Omnibox';
|
|
21
|
+
import { Tip } from './src/display/Tip';
|
|
22
22
|
import { TembaMenu } from './src/list/TembaMenu';
|
|
23
|
-
import { Anchor } from './src/
|
|
24
|
-
import { Dropdown } from './src/
|
|
25
|
-
import { TabPane } from './src/
|
|
26
|
-
import { Tab } from './src/
|
|
27
|
-
import Label from './src/
|
|
28
|
-
import { ContactName } from './src/
|
|
29
|
-
import { ContactUrn } from './src/
|
|
30
|
-
import { ContactFields } from './src/
|
|
31
|
-
import { ContactFieldEditor } from './src/
|
|
23
|
+
import { Anchor } from './src/display/Anchor';
|
|
24
|
+
import { Dropdown } from './src/display/Dropdown';
|
|
25
|
+
import { TabPane } from './src/layout/TabPane';
|
|
26
|
+
import { Tab } from './src/layout/Tab';
|
|
27
|
+
import Label from './src/display/Label';
|
|
28
|
+
import { ContactName } from './src/display/ContactName';
|
|
29
|
+
import { ContactUrn } from './src/display/ContactUrn';
|
|
30
|
+
import { ContactFields } from './src/live/ContactFields';
|
|
31
|
+
import { ContactFieldEditor } from './src/live/ContactFieldEditor';
|
|
32
32
|
|
|
33
|
-
import { ContactBadges } from './src/
|
|
34
|
-
import { ContactPending } from './src/
|
|
35
|
-
import { TembaSlider } from './src/
|
|
33
|
+
import { ContactBadges } from './src/live/ContactBadges';
|
|
34
|
+
import { ContactPending } from './src/live/ContactPending';
|
|
35
|
+
import { TembaSlider } from './src/form/TembaSlider';
|
|
36
36
|
import { RunList } from './src/list/RunList';
|
|
37
37
|
import { FlowStoreElement } from './src/store/FlowStoreElement';
|
|
38
|
-
import { ContactNameFetch } from './src/
|
|
39
|
-
import { DatePicker } from './src/
|
|
40
|
-
import { FieldManager } from './src/
|
|
38
|
+
import { ContactNameFetch } from './src/live/ContactNameFetch';
|
|
39
|
+
import { DatePicker } from './src/form/DatePicker';
|
|
40
|
+
import { FieldManager } from './src/live/FieldManager';
|
|
41
41
|
import { SortableList } from './src/list/SortableList';
|
|
42
42
|
import { ContentMenu } from './src/list/ContentMenu';
|
|
43
|
-
import { TembaDate } from './src/
|
|
44
|
-
import { Compose } from './src/
|
|
45
|
-
import { Lightbox } from './src/
|
|
46
|
-
import { ColorPicker } from './src/
|
|
47
|
-
import { Resizer } from './src/
|
|
48
|
-
import { Thumbnail } from './src/
|
|
43
|
+
import { TembaDate } from './src/display/TembaDate';
|
|
44
|
+
import { Compose } from './src/form/Compose';
|
|
45
|
+
import { Lightbox } from './src/display/Lightbox';
|
|
46
|
+
import { ColorPicker } from './src/form/ColorPicker';
|
|
47
|
+
import { Resizer } from './src/layout/Resizer';
|
|
48
|
+
import { Thumbnail } from './src/display/Thumbnail';
|
|
49
49
|
import { NotificationList } from './src/list/NotificationList';
|
|
50
50
|
import { WebChat } from './src/webchat/WebChat';
|
|
51
|
-
import { ImagePicker } from './src/
|
|
52
|
-
import { Mask } from './src/
|
|
53
|
-
import { TembaUser } from './src/
|
|
54
|
-
import { TemplateEditor } from './src/
|
|
55
|
-
import { Toast } from './src/
|
|
56
|
-
import { Chat } from './src/
|
|
57
|
-
import { MediaPicker } from './src/
|
|
51
|
+
import { ImagePicker } from './src/form/ImagePicker';
|
|
52
|
+
import { Mask } from './src/layout/Mask';
|
|
53
|
+
import { TembaUser } from './src/display/TembaUser';
|
|
54
|
+
import { TemplateEditor } from './src/form/TemplateEditor';
|
|
55
|
+
import { Toast } from './src/display/Toast';
|
|
56
|
+
import { Chat } from './src/display/Chat';
|
|
57
|
+
import { MediaPicker } from './src/form/MediaPicker';
|
|
58
58
|
import { Editor } from './src/flow/Editor';
|
|
59
59
|
import { EditorNode } from './src/flow/EditorNode';
|
|
60
60
|
import { StickyNote } from './src/flow/StickyNote';
|
|
61
|
-
import { ContactNotepad } from './src/
|
|
62
|
-
import { ProgressBar } from './src/
|
|
63
|
-
import { StartProgress } from './src/
|
|
61
|
+
import { ContactNotepad } from './src/live/ContactNotepad';
|
|
62
|
+
import { ProgressBar } from './src/display/ProgressBar';
|
|
63
|
+
import { StartProgress } from './src/live/StartProgress';
|
|
64
64
|
import { ShortcutList } from './src/list/ShortcutList';
|
|
65
|
-
import { PopupSelect } from './src/select/PopupSelect';
|
|
66
|
-
import { UserSelect } from './src/select/UserSelect';
|
|
67
|
-
import { WorkspaceSelect } from './src/select/WorkspaceSelect';
|
|
68
|
-
import { TembaChart } from './src/
|
|
69
|
-
import { RangePicker } from './src/
|
|
65
|
+
import { PopupSelect } from './src/form/select/PopupSelect';
|
|
66
|
+
import { UserSelect } from './src/form/select/UserSelect';
|
|
67
|
+
import { WorkspaceSelect } from './src/form/select/WorkspaceSelect';
|
|
68
|
+
import { TembaChart } from './src/live/TembaChart';
|
|
69
|
+
import { RangePicker } from './src/form/RangePicker';
|
|
70
70
|
|
|
71
71
|
export function addCustomElement(name: string, comp: any) {
|
|
72
72
|
if (!window.customElements.get(name)) {
|
package/temba-webchat.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Chat } from './src/
|
|
2
|
-
import { VectorIcon } from './src/
|
|
1
|
+
import { Chat } from './src/display/Chat';
|
|
2
|
+
import { VectorIcon } from './src/display/Icon';
|
|
3
3
|
import { WebChat } from './src/webchat/WebChat';
|
|
4
4
|
|
|
5
5
|
export function addCustomElement(name: string, comp: any) {
|
package/test/temba-alert.test.ts
CHANGED
|
@@ -216,3 +216,111 @@ describe('AppState Language Reset', () => {
|
|
|
216
216
|
assert.equal(zustand.getState().isTranslating, false);
|
|
217
217
|
});
|
|
218
218
|
});
|
|
219
|
+
|
|
220
|
+
describe('AppState Sticky Note Creation', () => {
|
|
221
|
+
beforeEach(() => {
|
|
222
|
+
// Reset the store state before each test
|
|
223
|
+
const state = zustand.getState();
|
|
224
|
+
zustand.setState({
|
|
225
|
+
...state,
|
|
226
|
+
languageCode: '',
|
|
227
|
+
isTranslating: false,
|
|
228
|
+
flowDefinition: {
|
|
229
|
+
language: 'en',
|
|
230
|
+
localization: {},
|
|
231
|
+
name: 'Test Flow',
|
|
232
|
+
nodes: [],
|
|
233
|
+
uuid: 'test-uuid',
|
|
234
|
+
type: 'messaging' as const,
|
|
235
|
+
revision: 1,
|
|
236
|
+
spec_version: '14.3',
|
|
237
|
+
_ui: {
|
|
238
|
+
nodes: {},
|
|
239
|
+
stickies: {},
|
|
240
|
+
languages: []
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
flowInfo: {
|
|
244
|
+
results: [],
|
|
245
|
+
dependencies: [],
|
|
246
|
+
counts: { nodes: 0, languages: 1 },
|
|
247
|
+
locals: []
|
|
248
|
+
},
|
|
249
|
+
dirtyDate: null
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it('should create a new sticky note with correct defaults', () => {
|
|
254
|
+
const state = zustand.getState();
|
|
255
|
+
|
|
256
|
+
const position = { left: 100, top: 200 };
|
|
257
|
+
const stickyUuid = state.createStickyNote(position);
|
|
258
|
+
|
|
259
|
+
// Verify UUID was returned
|
|
260
|
+
assert.isString(stickyUuid);
|
|
261
|
+
assert.isTrue(stickyUuid.length > 0);
|
|
262
|
+
|
|
263
|
+
// Verify sticky was added to the flow definition
|
|
264
|
+
const currentState = zustand.getState();
|
|
265
|
+
const stickies = currentState.flowDefinition._ui.stickies;
|
|
266
|
+
|
|
267
|
+
assert.property(stickies, stickyUuid);
|
|
268
|
+
|
|
269
|
+
const createdSticky = stickies[stickyUuid];
|
|
270
|
+
assert.deepEqual(createdSticky.position, position);
|
|
271
|
+
assert.equal(createdSticky.title, '');
|
|
272
|
+
assert.equal(createdSticky.body, '');
|
|
273
|
+
assert.equal(createdSticky.color, 'yellow');
|
|
274
|
+
|
|
275
|
+
// Verify dirty date was set
|
|
276
|
+
assert.isNotNull(currentState.dirtyDate);
|
|
277
|
+
assert.instanceOf(currentState.dirtyDate, Date);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('should create multiple unique sticky notes', () => {
|
|
281
|
+
const state = zustand.getState();
|
|
282
|
+
|
|
283
|
+
const position1 = { left: 100, top: 200 };
|
|
284
|
+
const position2 = { left: 300, top: 400 };
|
|
285
|
+
|
|
286
|
+
const uuid1 = state.createStickyNote(position1);
|
|
287
|
+
const uuid2 = state.createStickyNote(position2);
|
|
288
|
+
|
|
289
|
+
// UUIDs should be different
|
|
290
|
+
assert.notEqual(uuid1, uuid2);
|
|
291
|
+
|
|
292
|
+
// Both stickies should exist
|
|
293
|
+
const currentState = zustand.getState();
|
|
294
|
+
const stickies = currentState.flowDefinition._ui.stickies;
|
|
295
|
+
|
|
296
|
+
assert.property(stickies, uuid1);
|
|
297
|
+
assert.property(stickies, uuid2);
|
|
298
|
+
|
|
299
|
+
// Positions should be correct
|
|
300
|
+
assert.deepEqual(stickies[uuid1].position, position1);
|
|
301
|
+
assert.deepEqual(stickies[uuid2].position, position2);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('should initialize stickies object if it does not exist', () => {
|
|
305
|
+
// Set up state without stickies
|
|
306
|
+
const state = zustand.getState();
|
|
307
|
+
zustand.setState({
|
|
308
|
+
...state,
|
|
309
|
+
flowDefinition: {
|
|
310
|
+
...state.flowDefinition,
|
|
311
|
+
_ui: {
|
|
312
|
+
...state.flowDefinition._ui,
|
|
313
|
+
stickies: undefined
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
const position = { left: 50, top: 75 };
|
|
319
|
+
const stickyUuid = state.createStickyNote(position);
|
|
320
|
+
|
|
321
|
+
// Verify stickies object was created
|
|
322
|
+
const currentState = zustand.getState();
|
|
323
|
+
assert.isObject(currentState.flowDefinition._ui.stickies);
|
|
324
|
+
assert.property(currentState.flowDefinition._ui.stickies, stickyUuid);
|
|
325
|
+
});
|
|
326
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fixture } from '@open-wc/testing';
|
|
2
|
-
import { CharCount } from '../src/
|
|
2
|
+
import { CharCount } from '../src/display/CharCount';
|
|
3
3
|
import { assertScreenshot, getClip } from './utils.test';
|
|
4
4
|
|
|
5
5
|
const parentNode = document.createElement('div');
|
package/test/temba-chart.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from '@open-wc/testing';
|
|
2
|
-
import { ColorPicker } from '../src/
|
|
2
|
+
import { ColorPicker } from '../src/form/ColorPicker';
|
|
3
3
|
import { assertScreenshot, getClip, getComponent } from './utils.test';
|
|
4
4
|
|
|
5
5
|
const TAG = 'temba-color-picker';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useFakeTimers } from 'sinon';
|
|
2
|
-
import { Compose } from '../src/
|
|
3
|
-
import { ContactChat } from '../src/
|
|
1
|
+
import { SinonStub, useFakeTimers } from 'sinon';
|
|
2
|
+
import { Compose } from '../src/form/Compose';
|
|
3
|
+
import { ContactChat } from '../src/live/ContactChat';
|
|
4
4
|
import { Attachment, CustomEventType } from '../src/interfaces';
|
|
5
5
|
import {
|
|
6
6
|
assertScreenshot,
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
import { expect, oneEvent } from '@open-wc/testing';
|
|
21
21
|
|
|
22
22
|
let clock: any;
|
|
23
|
-
mockNow('2021-03-31T00:31:00.000-00:00');
|
|
24
23
|
|
|
25
24
|
const TAG = 'temba-contact-chat';
|
|
26
25
|
const getContactChat = async (attrs: any = {}) => {
|
|
@@ -49,9 +48,11 @@ const getResponseSuccessFiles = (attachments: Attachment[]) => {
|
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
describe('temba-contact-chat', () => {
|
|
51
|
+
let mockedNow: SinonStub;
|
|
52
52
|
// map requests for contact history to our static files
|
|
53
53
|
// we'll just us the same historylist for everybody for now
|
|
54
54
|
beforeEach(() => {
|
|
55
|
+
mockedNow = mockNow('2021-03-31T00:31:00.000-00:00');
|
|
55
56
|
clearMockPosts();
|
|
56
57
|
mockGET(
|
|
57
58
|
/\/contact\/history\/contact-.*/,
|
|
@@ -69,6 +70,7 @@ describe('temba-contact-chat', () => {
|
|
|
69
70
|
|
|
70
71
|
afterEach(function () {
|
|
71
72
|
clock.restore();
|
|
73
|
+
mockedNow.restore();
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
it('show history and show chatbox if contact is active', async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert, waitUntil } from '@open-wc/testing';
|
|
2
|
-
import { ContactDetails } from '../src/
|
|
2
|
+
import { ContactDetails } from '../src/live/ContactDetails';
|
|
3
3
|
import { getComponent, loadStore, mockGET } from './utils.test';
|
|
4
4
|
|
|
5
5
|
const TAG = 'temba-contact-details';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert, expect } from '@open-wc/testing';
|
|
2
|
-
import { ContactFields } from '../src/
|
|
2
|
+
import { ContactFields } from '../src/live/ContactFields';
|
|
3
3
|
import { delay, getComponent, loadStore, mockPOST } from './utils.test';
|
|
4
4
|
|
|
5
5
|
const TAG = 'temba-contact-fields';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fixture, assert, expect } from '@open-wc/testing';
|
|
2
|
-
import { ContactSearch } from '../src/
|
|
2
|
+
import { ContactSearch } from '../src/form/ContactSearch';
|
|
3
3
|
import { assertScreenshot, getClip, getHTML, mockPOST } from './utils.test';
|
|
4
4
|
import { useFakeTimers } from 'sinon';
|
|
5
5
|
import { CustomEventType } from '../src/interfaces';
|
|
6
|
-
import { Omnibox } from '../src/
|
|
6
|
+
import { Omnibox } from '../src/form/select/Omnibox';
|
|
7
7
|
|
|
8
8
|
let clock: any;
|
|
9
9
|
|
package/test/temba-date.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, fixture, expect } from '@open-wc/testing';
|
|
2
|
-
import { TembaDate } from '../src/
|
|
2
|
+
import { TembaDate } from '../src/display/TembaDate';
|
|
3
3
|
import {
|
|
4
4
|
assertScreenshot,
|
|
5
5
|
getClip,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
loadStore,
|
|
8
8
|
mockNow
|
|
9
9
|
} from './utils.test';
|
|
10
|
+
import { SinonStub } from 'sinon';
|
|
10
11
|
|
|
11
12
|
const TAG = 'temba-date';
|
|
12
13
|
|
|
@@ -15,13 +16,17 @@ export const getDate = async (attrs: any = {}) => {
|
|
|
15
16
|
return (await getComponent(TAG, attrs)) as TembaDate;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
mockNow('2022-12-02T21:00:00.000000');
|
|
19
|
-
|
|
20
19
|
describe('temba-date', () => {
|
|
20
|
+
let mockedNow: SinonStub;
|
|
21
21
|
beforeEach(() => {
|
|
22
|
+
mockedNow = mockNow('2022-12-02T21:00:00.000000');
|
|
22
23
|
loadStore();
|
|
23
24
|
});
|
|
24
25
|
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
mockedNow.restore();
|
|
28
|
+
});
|
|
29
|
+
|
|
25
30
|
it('renders default', async () => {
|
|
26
31
|
const date = await getDate({ value: '1978-11-18T02:22:00.000000' });
|
|
27
32
|
const dateString = (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fixture, expect, assert } from '@open-wc/testing';
|
|
2
|
-
import { DatePicker } from '../src/
|
|
2
|
+
import { DatePicker } from '../src/form/DatePicker';
|
|
3
3
|
import { assertScreenshot, getAttributes, getClip } from './utils.test';
|
|
4
4
|
|
|
5
5
|
export const getPickerHTML = (attrs: any = {}) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert, expect, fixture } from '@open-wc/testing';
|
|
2
2
|
import * as sinon from 'sinon';
|
|
3
|
-
import { Dialog } from '../src/
|
|
3
|
+
import { Dialog } from '../src/layout/Dialog';
|
|
4
4
|
import { assertScreenshot, getClip } from './utils.test';
|
|
5
5
|
|
|
6
6
|
const getDialogClip = (dialog: Dialog) => {
|