@nyaruka/temba-components 0.62.2 → 0.63.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 +13 -0
- package/demo/index.html +0 -11
- package/dist/{ba373419.js → b745b4f0.js} +423 -256
- package/dist/index.js +423 -256
- 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/RapidElement.js +6 -0
- package/out-tsc/src/RapidElement.js.map +1 -1
- package/out-tsc/src/compose/Compose.js +190 -89
- package/out-tsc/src/compose/Compose.js.map +1 -1
- package/out-tsc/src/contacts/ContactChat.js +4 -5
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/lightbox/Lightbox.js +1 -0
- package/out-tsc/src/lightbox/Lightbox.js.map +1 -1
- package/out-tsc/src/select/Select.js +1 -1
- package/out-tsc/src/select/Select.js.map +1 -1
- package/out-tsc/src/tabpane/Tab.js.map +1 -1
- package/out-tsc/src/tabpane/TabPane.js +155 -25
- package/out-tsc/src/tabpane/TabPane.js.map +1 -1
- package/out-tsc/src/textinput/TextInput.js +1 -0
- package/out-tsc/src/textinput/TextInput.js.map +1 -1
- package/out-tsc/src/thumbnail/Thumbnail.js +121 -0
- package/out-tsc/src/thumbnail/Thumbnail.js.map +1 -0
- package/out-tsc/src/utils/index.js +6 -0
- package/out-tsc/src/utils/index.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +2 -1
- 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 +2 -1
- package/out-tsc/test/temba-compose.test.js.map +1 -1
- package/out-tsc/test/temba-contact-chat.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/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/src/RapidElement.ts +7 -0
- package/src/compose/Compose.ts +200 -106
- package/src/contacts/ContactChat.ts +4 -5
- package/src/interfaces.ts +9 -0
- package/src/lightbox/Lightbox.ts +1 -0
- package/src/select/Select.ts +1 -1
- package/src/tabpane/Tab.ts +1 -1
- package/src/tabpane/TabPane.ts +154 -26
- package/src/textinput/TextInput.ts +1 -0
- package/src/thumbnail/Thumbnail.ts +119 -0
- package/src/utils/index.ts +8 -1
- package/src/vectoricon/index.ts +2 -1
- package/static/svg/index.svg +1 -1
- package/static/svg/work/traced/dotpoints-01.svg +1 -0
- package/static/svg/work/used/dotpoints-01.svg +3 -0
- package/temba-modules.ts +2 -0
- package/test/temba-compose.test.ts +8 -2
- package/test/temba-contact-chat.test.ts +2 -2
|
@@ -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.088 4.260 C 2.401 4.599,2.027 5.212,2.027 6.000 C 2.027 6.799,2.408 7.411,3.114 7.746 C 3.788 8.066,4.212 8.066,4.886 7.746 C 5.601 7.407,5.947 6.837,5.947 6.000 C 5.947 5.163,5.601 4.593,4.886 4.254 C 4.217 3.936,3.741 3.938,3.088 4.260 M8.560 5.148 C 7.865 5.549,7.805 6.223,8.422 6.708 C 8.832 7.031,9.013 7.040,15.044 7.040 C 20.790 7.040,21.271 7.019,21.602 6.750 C 22.029 6.405,22.075 5.687,21.694 5.306 C 21.457 5.068,20.756 5.036,15.154 5.002 C 10.647 4.975,8.790 5.016,8.560 5.148 M2.737 10.490 C 1.524 11.511,1.949 13.488,3.471 13.908 C 5.499 14.468,6.873 11.845,5.263 10.490 C 4.886 10.173,4.599 10.080,4.000 10.080 C 3.401 10.080,3.114 10.173,2.737 10.490 M8.249 11.396 C 8.112 11.591,8.000 11.863,8.000 12.000 C 8.000 12.137,8.112 12.409,8.249 12.604 L 8.498 12.960 14.944 12.960 C 20.986 12.960,21.407 12.942,21.655 12.667 C 22.005 12.281,21.992 11.635,21.627 11.305 C 21.365 11.068,20.664 11.040,14.916 11.040 L 8.498 11.040 8.249 11.396 M3.088 16.260 C 2.401 16.599,2.027 17.212,2.027 18.000 C 2.027 18.799,2.408 19.411,3.114 19.746 C 3.788 20.066,4.212 20.066,4.886 19.746 C 5.601 19.407,5.947 18.837,5.947 18.000 C 5.947 17.163,5.601 16.593,4.886 16.254 C 4.217 15.936,3.741 15.938,3.088 16.260 M8.560 17.148 C 7.865 17.549,7.805 18.223,8.422 18.708 C 8.832 19.031,9.013 19.040,15.044 19.040 C 20.790 19.040,21.271 19.019,21.602 18.750 C 22.029 18.405,22.075 17.687,21.694 17.306 C 21.457 17.068,20.756 17.036,15.154 17.002 C 10.647 16.975,8.790 17.016,8.560 17.148 " stroke="none" fill-rule="evenodd" fill="black"></path></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="M21 12L9 12M21 6L9 6M21 18L9 18M5 12C5 12.5523 4.55228 13 4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11C4.55228 11 5 11.4477 5 12ZM5 6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6C3 5.44772 3.44772 5 4 5C4.55228 5 5 5.44772 5 6ZM5 18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18C3 17.4477 3.44772 17 4 17C4.55228 17 5 17.4477 5 18Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/temba-modules.ts
CHANGED
|
@@ -48,6 +48,7 @@ import { Compose } from './src/compose/Compose';
|
|
|
48
48
|
import { Lightbox } from './src/lightbox/Lightbox';
|
|
49
49
|
import { ColorPicker } from './src/colorpicker/ColorPicker';
|
|
50
50
|
import { Resizer } from './src/resizer/Resizer';
|
|
51
|
+
import { Thumbnail } from './src/thumbnail/Thumbnail';
|
|
51
52
|
|
|
52
53
|
export function addCustomElement(name: string, comp: any) {
|
|
53
54
|
if (!window.customElements.get(name)) {
|
|
@@ -106,3 +107,4 @@ addCustomElement('temba-content-menu', ContentMenu);
|
|
|
106
107
|
addCustomElement('temba-compose', Compose);
|
|
107
108
|
addCustomElement('temba-color-picker', ColorPicker);
|
|
108
109
|
addCustomElement('temba-resizer', Resizer);
|
|
110
|
+
addCustomElement('temba-thumbnail', Thumbnail);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { assert, expect } from '@open-wc/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { Compose } from '../src/compose/Compose';
|
|
3
3
|
import { assertScreenshot, getClip, getComponent } from './utils.test';
|
|
4
4
|
import { Button } from '../src/button/Button';
|
|
5
5
|
import { Completion } from '../src/completion/Completion';
|
|
6
6
|
import { DEFAULT_MEDIA_ENDPOINT } from '../src/utils';
|
|
7
|
+
import { Attachment } from '../src/interfaces';
|
|
7
8
|
|
|
8
9
|
const TAG = 'temba-compose';
|
|
9
10
|
const getCompose = async (attrs: any = {}, width = 500, height = 500) => {
|
|
@@ -30,11 +31,16 @@ export const updateComponent = async (
|
|
|
30
31
|
await compose.updateComplete;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
const getInitialValue = (
|
|
34
|
+
const getInitialValue = (
|
|
35
|
+
text?: string,
|
|
36
|
+
attachments?: Attachment[],
|
|
37
|
+
quick_replies?: []
|
|
38
|
+
): any => {
|
|
34
39
|
const composeValue = {
|
|
35
40
|
und: {
|
|
36
41
|
text: text ? text : '',
|
|
37
42
|
attachments: attachments ? attachments : [],
|
|
43
|
+
quick_replies: quick_replies ? quick_replies : [],
|
|
38
44
|
},
|
|
39
45
|
};
|
|
40
46
|
return composeValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useFakeTimers } from 'sinon';
|
|
2
2
|
import { Button } from '../src/button/Button';
|
|
3
|
-
import {
|
|
3
|
+
import { Compose } from '../src/compose/Compose';
|
|
4
4
|
import { ContactChat } from '../src/contacts/ContactChat';
|
|
5
|
-
import { CustomEventType } from '../src/interfaces';
|
|
5
|
+
import { Attachment, CustomEventType } from '../src/interfaces';
|
|
6
6
|
import { TicketList } from '../src/list/TicketList';
|
|
7
7
|
import {
|
|
8
8
|
assertScreenshot,
|