@nyaruka/temba-components 0.41.7 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/demo/index.html +22 -0
- package/dist/{973a6cc2.js → f3b7c2f1.js} +397 -157
- package/dist/index.js +397 -157
- 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/button/Button.js +3 -3
- package/out-tsc/src/button/Button.js.map +1 -1
- package/out-tsc/src/charcount/CharCount.js +5 -4
- package/out-tsc/src/charcount/CharCount.js.map +1 -1
- package/out-tsc/src/completion/Completion.js +5 -0
- package/out-tsc/src/completion/Completion.js.map +1 -1
- package/out-tsc/src/compose/Compose.js +531 -0
- package/out-tsc/src/compose/Compose.js.map +1 -0
- package/out-tsc/src/contacts/ContactChat.js +73 -69
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/contacts/ContactHistory.js +1 -1
- package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
- package/out-tsc/src/contacts/events.js +1 -0
- package/out-tsc/src/contacts/events.js.map +1 -1
- package/out-tsc/src/interfaces.js +2 -0
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/textinput/TextInput.js +3 -1
- package/out-tsc/src/textinput/TextInput.js.map +1 -1
- package/out-tsc/src/utils/index.js +10 -0
- package/out-tsc/src/utils/index.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +1 -0
- package/out-tsc/src/vectoricon/index.js.map +1 -1
- package/out-tsc/temba-modules.js +2 -0
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/temba-compose.test.js +432 -0
- package/out-tsc/test/temba-compose.test.js.map +1 -0
- package/out-tsc/test/temba-contact-chat.test.js +219 -47
- package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
- package/out-tsc/test/temba-contact-history.test.js +7 -3
- package/out-tsc/test/temba-contact-history.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +12 -8
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +1 -1
- 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-active-ticket-closed-show-reopen-button.png +0 -0
- package/screenshots/truth/contacts/contact-active-ticket-open-show-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-archived-ticket-closed-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/history.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/src/button/Button.ts +3 -3
- package/src/charcount/CharCount.ts +5 -4
- package/src/completion/Completion.ts +4 -0
- package/src/compose/Compose.ts +584 -0
- package/src/contacts/ContactChat.ts +75 -78
- package/src/contacts/ContactHistory.ts +1 -1
- package/src/contacts/events.ts +1 -0
- package/src/interfaces.ts +2 -0
- package/src/textinput/TextInput.ts +3 -1
- package/src/utils/index.ts +12 -0
- package/src/vectoricon/index.ts +1 -0
- package/static/css/temba-components.css +6 -0
- package/temba-modules.ts +2 -0
- package/test/temba-compose.test.ts +633 -0
- package/test/temba-contact-chat.test.ts +354 -110
- package/test/temba-contact-history.test.ts +10 -5
- package/test/utils.test.ts +24 -9
- package/screenshots/truth/contacts/history-expanded.png +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png
ADDED
|
Binary file
|
|
Binary file
|
package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png
ADDED
|
Binary file
|
package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/button/Button.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class Button extends LitElement {
|
|
|
17
17
|
background-image: var(--button-bg-img);
|
|
18
18
|
color: var(--button-text);
|
|
19
19
|
box-shadow: var(--button-shadow);
|
|
20
|
-
transition: all
|
|
20
|
+
transition: all calc(var(--transition-speed) / 2) ease-in;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.button-container {
|
|
@@ -26,7 +26,7 @@ export class Button extends LitElement {
|
|
|
26
26
|
display: block;
|
|
27
27
|
border-radius: var(--curvature);
|
|
28
28
|
outline: none;
|
|
29
|
-
transition: background ease-in
|
|
29
|
+
transition: background ease-in var(--transition-speed);
|
|
30
30
|
user-select: none;
|
|
31
31
|
-webkit-user-select: none;
|
|
32
32
|
text-align: center;
|
|
@@ -61,7 +61,7 @@ export class Button extends LitElement {
|
|
|
61
61
|
padding: var(--button-y) var(--button-x);
|
|
62
62
|
border-radius: var(--curvature);
|
|
63
63
|
border: 1px solid transparent;
|
|
64
|
-
transition:
|
|
64
|
+
transition: var(--transition-speed);
|
|
65
65
|
background: var(--button-mask);
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -51,10 +51,11 @@ export class CharCount extends RapidElement {
|
|
|
51
51
|
transition: transform cubic-bezier(0.71, 0.18, 0.61, 1.33)
|
|
52
52
|
var(--transition-speed);
|
|
53
53
|
visibility: hidden;
|
|
54
|
-
margin-top:
|
|
55
|
-
right:
|
|
54
|
+
margin-top: var(--temba-charcount-summary-margin-top);
|
|
55
|
+
right: var(--temba-charcount-summary-right);
|
|
56
|
+
bottom: var(--temba-charcount-summary-bottom);
|
|
56
57
|
text-align: left;
|
|
57
|
-
position:
|
|
58
|
+
position: var(--temba-charcount-summary-position);
|
|
58
59
|
z-index: 1000;
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -86,7 +87,7 @@ export class CharCount extends RapidElement {
|
|
|
86
87
|
display: inline-block;
|
|
87
88
|
padding: 2px 6px;
|
|
88
89
|
border-radius: var(--curvature);
|
|
89
|
-
margin-top:
|
|
90
|
+
margin-top: var(--temba-charcount-counts-margin-top);
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
.segments {
|
|
@@ -115,6 +115,9 @@ export class Completion extends FormElement {
|
|
|
115
115
|
@property({ type: String })
|
|
116
116
|
counter: string;
|
|
117
117
|
|
|
118
|
+
@property({ type: Boolean })
|
|
119
|
+
autogrow = false;
|
|
120
|
+
|
|
118
121
|
private hiddenElement: HTMLInputElement;
|
|
119
122
|
private query: string;
|
|
120
123
|
|
|
@@ -258,6 +261,7 @@ export class Completion extends FormElement {
|
|
|
258
261
|
@input=${this.handleInput}
|
|
259
262
|
@blur=${this.handleOptionCanceled}
|
|
260
263
|
.value=${this.value}
|
|
264
|
+
?autogrow=${this.autogrow}
|
|
261
265
|
?textarea=${this.textarea}
|
|
262
266
|
?submitOnEnter=${this.submitOnEnter}
|
|
263
267
|
>
|