@nyaruka/temba-components 0.164.0 → 0.166.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 +20 -0
- package/DEV_DATA.md +11 -11
- package/README.md +4 -4
- package/TEST_OPTIMIZATION.md +8 -11
- package/dist/locales/es.js +4 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +4 -0
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/pt.js +4 -0
- package/dist/locales/pt.js.map +1 -1
- package/dist/static/svg/index.svg +1 -1
- package/dist/temba-components.js +1983 -865
- package/dist/temba-components.js.map +1 -1
- package/orca/setup.sh +2 -2
- package/package.json +13 -18
- package/scripts/dev-data-sync.mjs +4 -4
- package/src/Icons.ts +3 -2
- package/src/display/Chat.ts +232 -18
- package/src/display/ProgressBar.ts +15 -2
- package/src/form/Compose.ts +31 -1
- package/src/form/ContactSearch.ts +229 -126
- package/src/interfaces.ts +73 -0
- package/src/layout/Card.ts +25 -0
- package/src/layout/CardLayout.ts +3 -3
- package/src/layout/HeaderBar.ts +4 -1
- package/src/list/BroadcastList.ts +912 -0
- package/src/list/ContentList.ts +46 -10
- package/src/list/FieldList.ts +1057 -0
- package/src/list/NotificationList.ts +131 -21
- package/src/list/SortableList.ts +7 -2
- package/src/list/TembaList.ts +19 -5
- package/src/list/TembaMenu.ts +47 -46
- package/src/live/CampaignEvents.ts +33 -19
- package/src/live/ContactChat.ts +190 -18
- package/src/live/ContactDetails.ts +20 -13
- package/src/live/ContactFieldEditor.ts +7 -3
- package/src/live/ContactStoreElement.ts +3 -1
- package/src/live/ContactTimeline.ts +28 -7
- package/src/live/Realtime.ts +133 -0
- package/src/live/SocketService.ts +24 -0
- package/src/locales/es.ts +4 -0
- package/src/locales/fr.ts +4 -0
- package/src/locales/pt.ts +4 -0
- package/src/store/Store.ts +12 -0
- package/src/utils.ts +4 -0
- package/static/svg/index.svg +1 -1
- package/static/svg/packs/2-temba/star-filled.svg +3 -0
- package/static/svg/work/traced/star-filled.svg +1 -0
- package/static/svg/work/used/star-filled.svg +3 -0
- package/stress-test.js +3 -3
- package/temba-modules.ts +4 -0
- package/web-test-runner.config.mjs +1 -1
- package/xliff/es.xlf +12 -0
- package/xliff/fr.xlf +12 -0
- package/xliff/pt.xlf +12 -0
package/src/locales/pt.ts
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
'scf1453991c986b25': `Tab to complete, enter to select`,
|
|
14
14
|
'sbc913d7dc0f33877': `to add`,
|
|
15
15
|
's81f17cfc89a04338': `Interrupt flow`,
|
|
16
|
+
's122d4de68bcfcdf4': `It's okay to restart`,
|
|
17
|
+
's3eb2567092b4d7c1': `from the beginning`,
|
|
18
|
+
's28f37776b3901438': `It's okay to interrupt`,
|
|
19
|
+
's6838d20b10f7512a': `and start this one`,
|
|
16
20
|
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
17
21
|
's638236250662c6b3': `Have sent a message in the last`,
|
|
18
22
|
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
package/src/store/Store.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
DirtyTrackable
|
|
23
23
|
} from '../interfaces';
|
|
24
24
|
import { RapidElement } from '../RapidElement';
|
|
25
|
+
import { setRealtimeContext } from '../live/Realtime';
|
|
25
26
|
import { lru } from 'tiny-lru';
|
|
26
27
|
import { DateTime } from 'luxon';
|
|
27
28
|
import { css, html } from 'lit';
|
|
@@ -108,6 +109,14 @@ export class Store extends RapidElement {
|
|
|
108
109
|
@property({ type: String, attribute: 'shortcuts' })
|
|
109
110
|
shortcutsEndpoint: string;
|
|
110
111
|
|
|
112
|
+
// current workspace and user uuids, used to address user-scoped realtime
|
|
113
|
+
// channels - hydrated by the page template
|
|
114
|
+
@property({ type: String })
|
|
115
|
+
org: string;
|
|
116
|
+
|
|
117
|
+
@property({ type: String })
|
|
118
|
+
user: string;
|
|
119
|
+
|
|
111
120
|
@property({ type: String })
|
|
112
121
|
brand = '';
|
|
113
122
|
|
|
@@ -266,6 +275,9 @@ export class Store extends RapidElement {
|
|
|
266
275
|
}
|
|
267
276
|
|
|
268
277
|
public firstUpdated() {
|
|
278
|
+
if (this.org && this.user) {
|
|
279
|
+
setRealtimeContext({ org: this.org, user: this.user });
|
|
280
|
+
}
|
|
269
281
|
this.reset();
|
|
270
282
|
}
|
|
271
283
|
|
package/src/utils.ts
CHANGED
|
@@ -339,6 +339,10 @@ export const postJSON = (url: string, payload: any): Promise<WebResponse> => {
|
|
|
339
339
|
return postUrl(url, JSON.stringify(payload), false, 'application/json');
|
|
340
340
|
};
|
|
341
341
|
|
|
342
|
+
export const deleteRequest = (url: string): Promise<Response> => {
|
|
343
|
+
return fetch(url, { method: 'DELETE', headers: getHeaders() });
|
|
344
|
+
};
|
|
345
|
+
|
|
342
346
|
export const postFormData = (
|
|
343
347
|
url: string,
|
|
344
348
|
formData: FormData,
|