@nyaruka/temba-components 0.58.1 → 0.58.8
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/.devcontainer/Dockerfile +14 -0
- package/.devcontainer/devcontainer.json +17 -0
- package/.dockerignore +1 -0
- package/.github/workflows/build.yml +16 -14
- package/.github/workflows/publish.yml +9 -9
- package/.yarnrc +1 -0
- package/.yarnrc.yml +5 -0
- package/CHANGELOG.md +51 -0
- package/README.md +0 -8
- package/dist/{5f784089.js → 82b805ce.js} +36 -6
- package/dist/index.js +36 -6
- package/dist/static/svg/index.svg +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/templates/components-body.html +1 -1
- package/dist/templates/components-head.html +1 -1
- package/out-tsc/src/FormElement.js.map +1 -1
- package/out-tsc/src/contacts/events.js +39 -1
- package/out-tsc/src/contacts/events.js.map +1 -1
- package/out-tsc/src/fields/FieldManager.js +3 -1
- package/out-tsc/src/fields/FieldManager.js.map +1 -1
- package/out-tsc/src/store/Store.js +3 -0
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +3 -1
- package/out-tsc/src/vectoricon/index.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-history.test.js +1 -1
- package/out-tsc/test/temba-contact-history.test.js.map +1 -1
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +4 -5
- package/screenshots/truth/alert/error.png +0 -0
- package/screenshots/truth/alert/info.png +0 -0
- package/screenshots/truth/alert/warning.png +0 -0
- package/screenshots/truth/checkbox/checkbox-label-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-no-label-no-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-whitespace-label-no-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checked.png +0 -0
- package/screenshots/truth/checkbox/default.png +0 -0
- package/screenshots/truth/colorpicker/default.png +0 -0
- package/screenshots/truth/colorpicker/focused.png +0 -0
- package/screenshots/truth/colorpicker/initialized.png +0 -0
- package/screenshots/truth/colorpicker/selected.png +0 -0
- package/screenshots/truth/compose/attachments-and-send-button.png +0 -0
- package/screenshots/truth/compose/attachments-no-send-button.png +0 -0
- package/screenshots/truth/compose/attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-no-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-no-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-spaces.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-url.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-no-spaces.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text.png +0 -0
- package/screenshots/truth/contacts/badges.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
- package/screenshots/truth/contacts/contact-active-default.png +0 -0
- package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-blocked-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-stopped-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/details.png +0 -0
- package/screenshots/truth/contacts/fields-updated.png +0 -0
- package/screenshots/truth/contacts/fields.png +0 -0
- package/screenshots/truth/contacts/history.png +0 -0
- package/screenshots/truth/contacts/tickets-assignment.png +0 -0
- package/screenshots/truth/contacts/tickets.png +0 -0
- package/screenshots/truth/content-menu/button-no-items.png +0 -0
- package/screenshots/truth/content-menu/item-no-buttons.png +0 -0
- package/screenshots/truth/content-menu/items-and-buttons.png +0 -0
- package/screenshots/truth/counter/summary.png +0 -0
- package/screenshots/truth/counter/text.png +0 -0
- package/screenshots/truth/counter/unicode-variables.png +0 -0
- package/screenshots/truth/counter/unicode.png +0 -0
- package/screenshots/truth/counter/variable.png +0 -0
- package/screenshots/truth/date/date.png +0 -0
- package/screenshots/truth/date/datetime.png +0 -0
- package/screenshots/truth/date/duration.png +0 -0
- package/screenshots/truth/datepicker/date-truncated-time.png +0 -0
- package/screenshots/truth/datepicker/date.png +0 -0
- package/screenshots/truth/datepicker/datetime.png +0 -0
- package/screenshots/truth/datepicker/initial-timezone.png +0 -0
- package/screenshots/truth/datepicker/initial-value.png +0 -0
- package/screenshots/truth/datepicker/updated-keyboard-date.png +0 -0
- package/screenshots/truth/datepicker/updated-keyboard.png +0 -0
- package/screenshots/truth/dialog/focused.png +0 -0
- package/screenshots/truth/label/custom.png +0 -0
- package/screenshots/truth/label/danger.png +0 -0
- package/screenshots/truth/label/dark.png +0 -0
- package/screenshots/truth/label/default-icon.png +0 -0
- package/screenshots/truth/label/no-icon.png +0 -0
- package/screenshots/truth/label/primary.png +0 -0
- package/screenshots/truth/label/secondary.png +0 -0
- package/screenshots/truth/label/shadow.png +0 -0
- package/screenshots/truth/label/tertiary.png +0 -0
- package/screenshots/truth/lightbox/img-zoomed.png +0 -0
- package/screenshots/truth/lightbox/img.png +0 -0
- package/screenshots/truth/list/fields-dragging.png +0 -0
- package/screenshots/truth/list/fields-filtered.png +0 -0
- package/screenshots/truth/list/fields-hovered.png +0 -0
- package/screenshots/truth/list/fields.png +0 -0
- package/screenshots/truth/list/items-selected.png +0 -0
- package/screenshots/truth/list/items-updated.png +0 -0
- package/screenshots/truth/list/items.png +0 -0
- package/screenshots/truth/list/sortable-dragging.png +0 -0
- package/screenshots/truth/list/sortable-dropped.png +0 -0
- package/screenshots/truth/list/sortable.png +0 -0
- package/screenshots/truth/menu/menu-focused-with items.png +0 -0
- package/screenshots/truth/menu/menu-refresh-1.png +0 -0
- package/screenshots/truth/menu/menu-refresh-2.png +0 -0
- package/screenshots/truth/menu/menu-root.png +0 -0
- package/screenshots/truth/menu/menu-submenu.png +0 -0
- package/screenshots/truth/menu/menu-tasks-nextup.png +0 -0
- package/screenshots/truth/menu/menu-tasks.png +0 -0
- package/screenshots/truth/modax/form.png +0 -0
- package/screenshots/truth/modax/simple.png +0 -0
- package/screenshots/truth/options/block.png +0 -0
- package/screenshots/truth/select/disabled-multi-selection.png +0 -0
- package/screenshots/truth/select/disabled-selection.png +0 -0
- package/screenshots/truth/select/disabled.png +0 -0
- package/screenshots/truth/select/embedded.png +0 -0
- package/screenshots/truth/select/expression-selected.png +0 -0
- package/screenshots/truth/select/expressions.png +0 -0
- package/screenshots/truth/select/functions.png +0 -0
- package/screenshots/truth/select/local-options.png +0 -0
- package/screenshots/truth/select/remote-options.png +0 -0
- package/screenshots/truth/select/search-enabled.png +0 -0
- package/screenshots/truth/select/search-multi-no-matches.png +0 -0
- package/screenshots/truth/select/search-selected-focus.png +0 -0
- package/screenshots/truth/select/search-selected.png +0 -0
- package/screenshots/truth/select/search-with-selected.png +0 -0
- package/screenshots/truth/select/searching.png +0 -0
- package/screenshots/truth/select/selected-multi.png +0 -0
- package/screenshots/truth/select/selected-single.png +0 -0
- package/screenshots/truth/select/selection-clearable.png +0 -0
- package/screenshots/truth/select/truncated-selection.png +0 -0
- package/screenshots/truth/select/with-placeholder.png +0 -0
- package/screenshots/truth/select/without-placeholder.png +0 -0
- package/screenshots/truth/slider/custom-min-custom-max-valid-value.png +0 -0
- package/screenshots/truth/slider/custom-min-default-max-no-value.png +0 -0
- package/screenshots/truth/slider/default-min-custom-max-no-value.png +0 -0
- package/screenshots/truth/slider/default-min-default-max-invalid-value.png +0 -0
- package/screenshots/truth/slider/default-min-default-max-valid-value.png +0 -0
- package/screenshots/truth/slider/default.png +0 -0
- package/screenshots/truth/slider/no-visible-range-invalid-value.png +0 -0
- package/screenshots/truth/slider/no-visible-range-no-value.png +0 -0
- package/screenshots/truth/slider/no-visible-range-valid-value.png +0 -0
- package/screenshots/truth/slider/update-slider-on-circle-dragged.png +0 -0
- package/screenshots/truth/slider/update-slider-on-track-clicked.png +0 -0
- package/screenshots/truth/slider/update-slider-on-value-change.png +0 -0
- package/screenshots/truth/textinput/input-disabled.png +0 -0
- package/screenshots/truth/textinput/input-focused.png +0 -0
- package/screenshots/truth/textinput/input-form.png +0 -0
- package/screenshots/truth/textinput/input-inserted.png +0 -0
- package/screenshots/truth/textinput/input-placeholder.png +0 -0
- package/screenshots/truth/textinput/input-updated.png +0 -0
- package/screenshots/truth/textinput/input.png +0 -0
- package/screenshots/truth/textinput/textarea-focused.png +0 -0
- package/screenshots/truth/textinput/textarea.png +0 -0
- package/screenshots/truth/tip/bottom.png +0 -0
- package/screenshots/truth/tip/left.png +0 -0
- package/screenshots/truth/tip/right.png +0 -0
- package/screenshots/truth/tip/top.png +0 -0
- package/src/FormElement.ts +0 -1
- package/src/contacts/events.ts +38 -1
- package/src/fields/FieldManager.ts +3 -1
- package/src/store/Store.ts +4 -0
- package/src/vectoricon/index.ts +3 -1
- package/static/css/temba-components.css +41 -41
- package/static/svg/index.svg +1 -1
- package/static/svg/work/traced/dots-grid.svg +1 -0
- package/static/svg/work/traced/layers-three-01.svg +1 -0
- package/static/svg/work/used/dots-grid.svg +11 -0
- package/static/svg/work/used/layers-three-01.svg +3 -0
- package/test/temba-contact-details.test.ts +2 -1
- package/test/temba-contact-history.test.ts +1 -1
- package/test/utils.test.ts +1 -0
- package/test-assets/style.css +53 -33
- package/web-test-runner.config.mjs +21 -17
- package/screenshots/truth/contact-search/manual-search.png +0 -0
- package/screenshots/truth/contact-search/missing-group.png +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.931 3.351 C 2.953 3.996,2.722 5.358,3.445 6.217 C 4.250 7.174,5.530 7.245,6.394 6.381 C 8.024 4.751,5.854 2.083,3.931 3.351 M10.864 3.406 C 9.804 4.119,9.742 5.543,10.729 6.489 C 11.136 6.879,11.356 6.960,12.000 6.960 C 12.644 6.960,12.864 6.879,13.271 6.489 C 15.082 4.753,12.940 2.009,10.864 3.406 M17.950 3.364 C 16.872 4.022,16.705 5.481,17.606 6.381 C 18.181 6.957,18.854 7.126,19.594 6.882 C 21.185 6.357,21.465 4.272,20.069 3.351 C 19.463 2.952,18.618 2.957,17.950 3.364 M3.815 10.441 C 2.951 11.171,2.791 12.223,3.406 13.136 C 4.119 14.196,5.543 14.258,6.489 13.271 C 6.882 12.860,6.960 12.647,6.960 11.977 C 6.960 11.256,6.900 11.121,6.362 10.628 C 5.856 10.164,5.648 10.080,5.002 10.081 C 4.446 10.081,4.125 10.179,3.815 10.441 M10.737 10.490 C 9.524 11.511,9.949 13.488,11.471 13.908 C 12.950 14.316,14.313 12.938,13.902 11.450 C 13.540 10.139,11.786 9.607,10.737 10.490 M17.638 10.628 C 17.100 11.121,17.040 11.256,17.040 11.977 C 17.040 12.647,17.118 12.860,17.511 13.271 C 17.770 13.541,18.226 13.830,18.525 13.912 C 20.136 14.357,21.512 12.572,20.728 11.056 C 20.394 10.409,19.799 10.080,18.963 10.080 C 18.357 10.080,18.135 10.172,17.638 10.628 M4.226 17.182 C 3.497 17.508,3.040 18.173,3.040 18.910 C 3.040 20.182,3.832 20.960,5.128 20.960 C 6.445 20.960,7.381 19.407,6.801 18.185 C 6.336 17.205,5.182 16.756,4.226 17.182 M11.280 17.178 C 9.804 17.849,9.575 19.727,10.864 20.594 C 11.534 21.045,12.385 21.066,13.070 20.648 C 13.707 20.259,13.964 19.791,13.964 19.015 C 13.964 17.636,12.491 16.628,11.280 17.178 M18.441 17.073 C 17.937 17.170,17.166 17.988,17.040 18.559 C 16.786 19.716,17.750 20.960,18.900 20.960 C 20.168 20.960,20.960 20.172,20.960 18.910 C 20.960 18.157,20.493 17.496,19.738 17.181 C 19.205 16.958,19.089 16.948,18.441 17.073 " stroke="none" fill-rule="evenodd" fill="black"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.355 3.692 C 0.868 6.448,0.642 6.611,1.182 7.435 C 1.370 7.721,2.987 8.613,6.564 10.402 C 9.377 11.809,11.823 12.960,12.000 12.960 C 12.177 12.960,14.689 11.776,17.581 10.329 C 22.109 8.065,22.855 7.641,22.944 7.286 C 23.001 7.059,22.971 6.729,22.877 6.554 C 22.624 6.082,12.634 1.117,11.961 1.129 C 11.619 1.134,9.691 2.016,6.355 3.692 M15.999 5.109 L 19.757 7.000 15.879 8.941 L 12.000 10.881 8.121 8.941 L 4.243 7.000 8.001 5.109 C 10.069 4.068,11.868 3.217,12.000 3.217 C 12.132 3.217,13.931 4.068,15.999 5.109 M1.418 11.203 C 1.069 11.407,0.911 12.089,1.122 12.483 C 1.351 12.912,11.371 17.920,12.000 17.920 C 12.706 17.920,22.685 12.892,22.896 12.430 C 23.135 11.904,22.834 11.235,22.298 11.100 C 21.943 11.011,20.975 11.436,16.932 13.454 L 11.998 15.917 7.118 13.478 C 4.435 12.137,2.113 11.042,1.959 11.045 C 1.806 11.048,1.562 11.119,1.418 11.203 M1.292 16.422 C 0.913 16.902,0.895 17.019,1.127 17.454 C 1.358 17.885,11.367 22.880,12.000 22.880 C 12.303 22.880,14.389 21.926,17.606 20.317 C 23.213 17.512,23.408 17.369,22.771 16.515 C 22.592 16.276,22.311 16.053,22.145 16.021 C 21.980 15.989,19.629 17.068,16.921 18.419 L 11.998 20.877 7.118 18.438 C 4.435 17.097,2.100 16.000,1.931 16.000 C 1.762 16.000,1.474 16.190,1.292 16.422 " stroke="none" fill-rule="evenodd" fill="black"></path></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M12 20C12.5523 20 13 19.5523 13 19C13 18.4477 12.5523 18 12 18C11.4477 18 11 18.4477 11 19C11 19.5523 11.4477 20 12 20Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M19 6C19.5523 6 20 5.55228 20 5C20 4.44772 19.5523 4 19 4C18.4477 4 18 4.44772 18 5C18 5.55228 18.4477 6 19 6Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
<path d="M19 20C19.5523 20 20 19.5523 20 19C20 18.4477 19.5523 18 19 18C18.4477 18 18 18.4477 18 19C18 19.5523 18.4477 20 19 20Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
<path d="M5 6C5.55228 6 6 5.55228 6 5C6 4.44772 5.55228 4 5 4C4.44772 4 4 4.44772 4 5C4 5.55228 4.44772 6 5 6Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
+
<path d="M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
|
+
<path d="M5 20C5.55228 20 6 19.5523 6 19C6 18.4477 5.55228 18 5 18C4.44772 18 4 18.4477 4 19C4 19.5523 4.44772 20 5 20Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2 12.0001L11.6422 16.8212C11.7734 16.8868 11.839 16.9196 11.9078 16.9325C11.9687 16.9439 12.0313 16.9439 12.0922 16.9325C12.161 16.9196 12.2266 16.8868 12.3578 16.8212L22 12.0001M2 17.0001L11.6422 21.8212C11.7734 21.8868 11.839 21.9196 11.9078 21.9325C11.9687 21.9439 12.0313 21.9439 12.0922 21.9325C12.161 21.9196 12.2266 21.8868 12.3578 21.8212L22 17.0001M2 7.00006L11.6422 2.17895C11.7734 2.11336 11.839 2.08056 11.9078 2.06766C11.9687 2.05622 12.0313 2.05622 12.0922 2.06766C12.161 2.08056 12.2266 2.11336 12.3578 2.17895L22 7.00006L12.3578 11.8212C12.2266 11.8868 12.161 11.9196 12.0922 11.9325C12.0313 11.9439 11.9687 11.9439 11.9078 11.9325C11.839 11.9196 11.7734 11.8868 11.6422 11.8212L2 7.00006Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -27,13 +27,14 @@ describe('temba-contact-tickets', () => {
|
|
|
27
27
|
/\/api\/v2\/contacts.json\?uuid=24d64810-3315-4ff5-be85-48e3fe055bf9/,
|
|
28
28
|
'/test-assets/contacts/contact-dave-active'
|
|
29
29
|
);
|
|
30
|
-
loadStore();
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
it('renders default', async () => {
|
|
33
|
+
await loadStore();
|
|
34
34
|
const contactDetails: ContactDetails = await getContactDetails({
|
|
35
35
|
contact: '24d64810-3315-4ff5-be85-48e3fe055bf9',
|
|
36
36
|
});
|
|
37
|
+
|
|
37
38
|
assert.instanceOf(contactDetails, ContactDetails);
|
|
38
39
|
await assertScreenshot('contacts/details', getClip(contactDetails));
|
|
39
40
|
});
|
|
@@ -80,7 +80,7 @@ describe('temba-contact-history', () => {
|
|
|
80
80
|
|
|
81
81
|
const events = history.shadowRoot.querySelector('.events');
|
|
82
82
|
const top = events.scrollHeight - events.getBoundingClientRect().height;
|
|
83
|
-
expect(top).to.equal(
|
|
83
|
+
expect(top).to.equal(571);
|
|
84
84
|
// make sure we actually scrolled to there
|
|
85
85
|
expect(events.scrollTop).to.equal(top);
|
|
86
86
|
await assertScreenshot('contacts/history', getHistoryClip(history));
|
package/test/utils.test.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { expect, fixture, html, assert, waitUntil } from '@open-wc/testing';
|
|
|
11
11
|
import MouseHelper from './MouseHelper';
|
|
12
12
|
import { Store } from '../src/store/Store';
|
|
13
13
|
import { replace, stub } from 'sinon';
|
|
14
|
+
import { CustomEventType } from '../src/interfaces';
|
|
14
15
|
|
|
15
16
|
export interface CodeMock {
|
|
16
17
|
endpoint: RegExp;
|
package/test-assets/style.css
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
#mocha {
|
|
2
|
-
display:none;
|
|
2
|
+
display: none;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
temba-dialog,
|
|
5
|
+
temba-dialog,
|
|
6
|
+
temba-modax,
|
|
7
|
+
temba-contact-history,
|
|
8
|
+
temba-menu,
|
|
9
|
+
temba-select {
|
|
6
10
|
--transition-speed: 0ms !important;
|
|
7
11
|
}
|
|
8
12
|
|
|
@@ -15,14 +19,16 @@ html input {
|
|
|
15
19
|
caret-color: transparent;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
temba-input,
|
|
22
|
+
temba-input,
|
|
23
|
+
temba-modax,
|
|
24
|
+
temba-dialog {
|
|
19
25
|
caret-color: transparent;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
html {
|
|
23
29
|
--transition-speed: 0ms !important;
|
|
24
30
|
--input-caret: transparent !important;
|
|
25
|
-
--font-family: '
|
|
31
|
+
--font-family: 'Roboto';
|
|
26
32
|
--primary-rgb: 35, 135, 202;
|
|
27
33
|
--secondary-rgb: 140, 51, 140;
|
|
28
34
|
--tertiary-rgb: 135, 202, 35;
|
|
@@ -72,7 +78,7 @@ html {
|
|
|
72
78
|
--color-text-help: rgba(0, 0, 0, 0.35);
|
|
73
79
|
|
|
74
80
|
--color-tertiary: rgb(var(--tertiary-rgb));
|
|
75
|
-
|
|
81
|
+
|
|
76
82
|
/* solid overlays with text */
|
|
77
83
|
--color-overlay-dark: rgba(0, 0, 0, 0.2);
|
|
78
84
|
--color-overlay-dark-text: rgba(255, 255, 255, 0.9);
|
|
@@ -121,9 +127,9 @@ html {
|
|
|
121
127
|
|
|
122
128
|
--options-block-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
|
|
123
129
|
--options-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
124
|
-
|
|
130
|
+
|
|
125
131
|
font-size: var(--font-size);
|
|
126
|
-
font-weight:
|
|
132
|
+
font-weight: 400;
|
|
127
133
|
font-family: var(--font-family);
|
|
128
134
|
--dropdown-shadow: rgb(0 0 0 / 30%) 0px 0px 60px, rgb(0 0 0 / 12%) 0px 6px 12px;
|
|
129
135
|
|
|
@@ -137,14 +143,14 @@ html {
|
|
|
137
143
|
--help-text-margin-top: 0px;
|
|
138
144
|
--help-text-margin-left: 0.3em;
|
|
139
145
|
--help-text-size: 0.85em;
|
|
140
|
-
--color-text-help: rgb(120,120,120);
|
|
146
|
+
--color-text-help: rgb(120, 120, 120);
|
|
141
147
|
--label-size: 14px;
|
|
142
|
-
|
|
148
|
+
|
|
143
149
|
--button-y: 6px;
|
|
144
150
|
--button-x: 14px;
|
|
145
151
|
|
|
146
152
|
--menu-padding: 1em;
|
|
147
|
-
--color-automated: rgb(78,205,106);
|
|
153
|
+
--color-automated: rgb(78, 205, 106);
|
|
148
154
|
}
|
|
149
155
|
|
|
150
156
|
temba-button {
|
|
@@ -155,11 +161,11 @@ temba-button {
|
|
|
155
161
|
}
|
|
156
162
|
|
|
157
163
|
temba-button:hover {
|
|
158
|
-
--button-bg-img: linear-gradient(to bottom, rgba(var(--primary-rgb)
|
|
164
|
+
--button-bg-img: linear-gradient(to bottom, rgba(var(--primary-rgb), .1), transparent, transparent);
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
temba-button.active {
|
|
162
|
-
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0,0,0
|
|
168
|
+
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .05));
|
|
163
169
|
}
|
|
164
170
|
|
|
165
171
|
temba-button.light {
|
|
@@ -171,18 +177,18 @@ temba-button.light {
|
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
temba-button.light:hover {
|
|
174
|
-
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0,0,0
|
|
180
|
+
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .001));
|
|
175
181
|
}
|
|
176
182
|
|
|
177
183
|
temba-button.light.active {
|
|
178
|
-
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0,0,0
|
|
184
|
+
--button-bg-img: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .02));
|
|
179
185
|
}
|
|
180
186
|
|
|
181
187
|
temba-contact-history {
|
|
182
|
-
min-height:0;
|
|
183
|
-
display:flex;
|
|
184
|
-
flex-grow:1;
|
|
185
|
-
flex-direction:column;
|
|
188
|
+
min-height: 0;
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-grow: 1;
|
|
191
|
+
flex-direction: column;
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
temba-select:focus {
|
|
@@ -204,43 +210,57 @@ temba-datepicker {
|
|
|
204
210
|
font-family: 'Roboto Mono';
|
|
205
211
|
font-style: normal;
|
|
206
212
|
font-weight: 400;
|
|
207
|
-
src:
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
src: url('./fonts/roboto-mono-v12-latin-regular.ttf'),
|
|
214
|
+
url('./fonts/roboto-mono-v12-latin-regular.woff2') format('woff2'),
|
|
215
|
+
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
216
|
+
url('./fonts/roboto-mono-v12-latin-regular.woff') format('woff');
|
|
217
|
+
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
210
218
|
}
|
|
219
|
+
|
|
211
220
|
/* roboto-mono-300 - latin */
|
|
212
221
|
@font-face {
|
|
213
222
|
font-family: 'Roboto Mono';
|
|
214
223
|
font-style: normal;
|
|
215
224
|
font-weight: 300;
|
|
216
|
-
src:
|
|
217
|
-
|
|
218
|
-
|
|
225
|
+
src: url('./fonts/roboto-mono-v12-latin-300.ttf'),
|
|
226
|
+
url('./fonts/roboto-mono-v12-latin-300.woff2') format('woff2'),
|
|
227
|
+
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
228
|
+
url('./fonts/roboto-mono-v12-latin-300.woff') format('woff');
|
|
229
|
+
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
219
230
|
}
|
|
231
|
+
|
|
220
232
|
/* roboto-300 - latin */
|
|
221
233
|
@font-face {
|
|
222
234
|
font-family: 'Roboto';
|
|
223
235
|
font-style: normal;
|
|
224
236
|
font-weight: 300;
|
|
225
|
-
src:
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
src: url('./fonts/roboto-v20-latin-300.ttf'),
|
|
238
|
+
url('./fonts/roboto-v20-latin-300.woff2') format('woff2'),
|
|
239
|
+
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
240
|
+
url('./fonts/roboto-v20-latin-300.woff') format('woff');
|
|
241
|
+
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
228
242
|
}
|
|
243
|
+
|
|
229
244
|
/* roboto-regular - latin */
|
|
230
245
|
@font-face {
|
|
231
246
|
font-family: 'Roboto';
|
|
232
247
|
font-style: normal;
|
|
233
248
|
font-weight: 400;
|
|
234
|
-
src:
|
|
235
|
-
|
|
236
|
-
|
|
249
|
+
src: url('./fonts/roboto-v20-latin-regular.ttf'),
|
|
250
|
+
url('./fonts/roboto-v20-latin-regular.woff2') format('woff2'),
|
|
251
|
+
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
252
|
+
url('./fonts/roboto-v20-latin-regular.woff') format('woff');
|
|
253
|
+
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
237
254
|
}
|
|
255
|
+
|
|
238
256
|
/* roboto-500 - latin */
|
|
239
257
|
@font-face {
|
|
240
258
|
font-family: 'Roboto';
|
|
241
259
|
font-style: normal;
|
|
242
260
|
font-weight: 500;
|
|
243
|
-
src:
|
|
244
|
-
|
|
245
|
-
|
|
261
|
+
src: url('./fonts/roboto-v20-latin-500.ttf'),
|
|
262
|
+
url('./fonts/roboto-v20-latin-500.woff2') format('woff2'),
|
|
263
|
+
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
264
|
+
url('./fonts/roboto-v20-latin-500.woff') format('woff');
|
|
265
|
+
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
246
266
|
}
|
|
@@ -127,7 +127,6 @@ const checkScreenshot = async (filename, excluded, threshold) => {
|
|
|
127
127
|
.createReadStream(testImg)
|
|
128
128
|
.pipe(new PNG())
|
|
129
129
|
.on('parsed', doneReading);
|
|
130
|
-
|
|
131
130
|
});
|
|
132
131
|
};
|
|
133
132
|
|
|
@@ -195,10 +194,10 @@ const wireScreenshots = async (page, context, wait) => {
|
|
|
195
194
|
}
|
|
196
195
|
);
|
|
197
196
|
|
|
198
|
-
await page.exposeFunction('waitForNetworkIdle', async () =>{
|
|
197
|
+
await page.exposeFunction('waitForNetworkIdle', async () => {
|
|
199
198
|
await page.waitForNetworkIdle();
|
|
200
199
|
});
|
|
201
|
-
|
|
200
|
+
|
|
202
201
|
await page.exposeFunction('setViewport', async options => {
|
|
203
202
|
await page.setViewport(options);
|
|
204
203
|
});
|
|
@@ -209,7 +208,7 @@ const wireScreenshots = async (page, context, wait) => {
|
|
|
209
208
|
|
|
210
209
|
await page.exposeFunction('moveMouse', (x, y) => {
|
|
211
210
|
return new Promise(async (resolve, reject) => {
|
|
212
|
-
await page.mouse.move(x, y, {steps: 5});
|
|
211
|
+
await page.mouse.move(x, y, { steps: 5 });
|
|
213
212
|
resolve();
|
|
214
213
|
});
|
|
215
214
|
});
|
|
@@ -223,14 +222,14 @@ const wireScreenshots = async (page, context, wait) => {
|
|
|
223
222
|
});
|
|
224
223
|
});
|
|
225
224
|
|
|
226
|
-
await page.exposeFunction('mouseDown', async() => {
|
|
225
|
+
await page.exposeFunction('mouseDown', async () => {
|
|
227
226
|
return new Promise(async (resolve, reject) => {
|
|
228
227
|
await page.mouse.down();
|
|
229
228
|
resolve();
|
|
230
229
|
});
|
|
231
230
|
});
|
|
232
231
|
|
|
233
|
-
await page.exposeFunction('mouseUp', async() => {
|
|
232
|
+
await page.exposeFunction('mouseUp', async () => {
|
|
234
233
|
return new Promise(async (resolve, reject) => {
|
|
235
234
|
await page.mouse.up();
|
|
236
235
|
resolve();
|
|
@@ -248,8 +247,7 @@ const wireScreenshots = async (page, context, wait) => {
|
|
|
248
247
|
await page.exposeFunction(
|
|
249
248
|
'typeInto',
|
|
250
249
|
async (selector, text, replace = false, enter = false) => {
|
|
251
|
-
|
|
252
|
-
const selectors = selector.split(":");
|
|
250
|
+
const selectors = selector.split(':');
|
|
253
251
|
const frame = await page.frames().find(f => {
|
|
254
252
|
return true;
|
|
255
253
|
});
|
|
@@ -258,15 +256,19 @@ const wireScreenshots = async (page, context, wait) => {
|
|
|
258
256
|
let codeSelector = `document.querySelector("${selectors[0]}")`;
|
|
259
257
|
selectors.shift();
|
|
260
258
|
if (selectors.length > 0) {
|
|
261
|
-
codeSelector +=
|
|
262
|
-
|
|
259
|
+
codeSelector +=
|
|
260
|
+
'.' +
|
|
261
|
+
selectors
|
|
262
|
+
.map(entry => `shadowRoot.querySelector("${entry}")`)
|
|
263
|
+
.join('.');
|
|
264
|
+
}
|
|
263
265
|
|
|
264
266
|
const element = await page.evaluateHandle(codeSelector);
|
|
265
267
|
await element.click({ clickCount: replace ? 3 : 1 });
|
|
266
268
|
await page.keyboard.type(text);
|
|
267
269
|
|
|
268
270
|
if (enter) {
|
|
269
|
-
await page.keyboard.press(
|
|
271
|
+
await page.keyboard.press('Enter');
|
|
270
272
|
}
|
|
271
273
|
}
|
|
272
274
|
);
|
|
@@ -307,7 +309,7 @@ export default {
|
|
|
307
309
|
}
|
|
308
310
|
},
|
|
309
311
|
},
|
|
310
|
-
esbuildPlugin({ ts: true })
|
|
312
|
+
esbuildPlugin({ ts: true }),
|
|
311
313
|
|
|
312
314
|
/* importMapsPlugin({
|
|
313
315
|
inject: {
|
|
@@ -329,14 +331,17 @@ export default {
|
|
|
329
331
|
'--force-color-profile=srgb',
|
|
330
332
|
'--hide-scrollbars',
|
|
331
333
|
'--disable-web-security',
|
|
332
|
-
'--force-device-scale-factor=1'
|
|
334
|
+
'--force-device-scale-factor=1',
|
|
335
|
+
'--no-sandbox',
|
|
333
336
|
],
|
|
334
|
-
headless: true,
|
|
337
|
+
headless: true,
|
|
335
338
|
},
|
|
336
339
|
createPage: async ({ context, config }) => {
|
|
337
|
-
const wait = !(config[
|
|
340
|
+
const wait = !(config['unknown'] || []).includes('--fast');
|
|
338
341
|
const page = await context.newPage();
|
|
339
|
-
await page.setUserAgent(
|
|
342
|
+
await page.setUserAgent(
|
|
343
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
|
|
344
|
+
);
|
|
340
345
|
await page.once('load', async () => {
|
|
341
346
|
await page.addScriptTag({
|
|
342
347
|
content: `
|
|
@@ -347,7 +352,6 @@ export default {
|
|
|
347
352
|
await wireScreenshots(page, context, wait);
|
|
348
353
|
});
|
|
349
354
|
|
|
350
|
-
|
|
351
355
|
await page.emulateTimezone('GMT');
|
|
352
356
|
|
|
353
357
|
return page;
|
|
Binary file
|
|
Binary file
|