@nyaruka/temba-components 0.130.4 → 0.131.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 +10 -13
- package/demo/sortable-rules-demo.html +155 -0
- package/dist/temba-components.js +150 -159
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/events.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +13 -7
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/actions/send_msg.js +1 -0
- package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_groups.js +149 -1
- package/out-tsc/src/flow/nodes/split_by_groups.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +1 -0
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_random.js +1 -0
- package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js +332 -137
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +301 -30
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/select/Omnibox.js +4 -0
- package/out-tsc/src/form/select/Omnibox.js.map +1 -1
- package/out-tsc/src/form/select/Select.js +21 -25
- package/out-tsc/src/form/select/Select.js.map +1 -1
- package/out-tsc/src/list/SortableList.js +214 -140
- package/out-tsc/src/list/SortableList.js.map +1 -1
- package/out-tsc/src/live/ContactChat.js +9 -5
- package/out-tsc/src/live/ContactChat.js.map +1 -1
- package/out-tsc/test/nodes/split_by_groups.test.js +130 -0
- package/out-tsc/test/nodes/split_by_groups.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_response.test.js +522 -8
- package/out-tsc/test/nodes/wait_for_response.test.js.map +1 -1
- package/out-tsc/test/temba-field-config.test.js +56 -0
- package/out-tsc/test/temba-field-config.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/actions/add_contact_groups/render/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/send_email/render/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/render/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/with-expressions.png +0 -0
- package/screenshots/truth/actions/send_msg/render/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-without-quick-replies.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/field-renderer/select-with-label.png +0 -0
- package/screenshots/truth/list/fields-dragging.png +0 -0
- package/screenshots/truth/list/sortable-dragging.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/short-timeout.png +0 -0
- package/screenshots/truth/select/search-enabled.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/templates/default.png +0 -0
- package/screenshots/truth/templates/unapproved.png +0 -0
- package/src/events.ts +6 -6
- package/src/flow/CanvasNode.ts +15 -13
- package/src/flow/actions/send_msg.ts +1 -0
- package/src/flow/nodes/split_by_groups.ts +190 -1
- package/src/flow/nodes/split_by_llm_categorize.ts +1 -0
- package/src/flow/nodes/split_by_random.ts +1 -0
- package/src/flow/nodes/wait_for_response.ts +424 -145
- package/src/form/ArrayEditor.ts +372 -30
- package/src/form/select/Omnibox.ts +3 -0
- package/src/form/select/Select.ts +24 -25
- package/src/list/SortableList.ts +250 -149
- package/src/live/ContactChat.ts +11 -5
- package/test/nodes/split_by_groups.test.ts +165 -0
- package/test/nodes/wait_for_response.test.ts +608 -8
- package/test/temba-field-config.test.ts +69 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,22 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### [v0.
|
|
8
|
-
|
|
7
|
+
#### [v0.131.0](https://github.com/nyaruka/temba-components/compare/v0.130.1...v0.131.0)
|
|
8
|
+
|
|
9
|
+
- Empty row focus, auto categories [`#707`](https://github.com/nyaruka/temba-components/pull/707)
|
|
10
|
+
- Fix omnibox [`#706`](https://github.com/nyaruka/temba-components/pull/706)
|
|
11
|
+
- Tweak msg event payload for chat history [`#704`](https://github.com/nyaruka/temba-components/pull/704)
|
|
12
|
+
- Add split by groups [`#699`](https://github.com/nyaruka/temba-components/pull/699)
|
|
13
|
+
- Some tweaks for smoother dragging [`#701`](https://github.com/nyaruka/temba-components/pull/701)
|
|
14
|
+
- Switch to cloned dragged items [`#700`](https://github.com/nyaruka/temba-components/pull/700)
|
|
15
|
+
- Show select fetching status [`#698`](https://github.com/nyaruka/temba-components/pull/698)
|
|
16
|
+
- Add sorting for wait for response [`#695`](https://github.com/nyaruka/temba-components/pull/695)
|
|
9
17
|
- Fix rendering of `ivr_created` events [`#697`](https://github.com/nyaruka/temba-components/pull/697)
|
|
10
18
|
- Update chat history test with more realistic event data [`#696`](https://github.com/nyaruka/temba-components/pull/696)
|
|
11
|
-
- Fix rendering of ivr_created events in chat history [`261f082`](https://github.com/nyaruka/temba-components/commit/261f082a6d8fbdc2244a1e59fa07a49f33439c36)
|
|
12
|
-
|
|
13
|
-
#### [v0.130.3](https://github.com/nyaruka/temba-components/compare/v0.130.2...v0.130.3)
|
|
14
|
-
|
|
15
|
-
> 23 September 2025
|
|
16
|
-
|
|
17
19
|
- Remove support for legacy ticket events [`#694`](https://github.com/nyaruka/temba-components/pull/694)
|
|
18
|
-
|
|
19
|
-
#### [v0.130.2](https://github.com/nyaruka/temba-components/compare/v0.130.1...v0.130.2)
|
|
20
|
-
|
|
21
|
-
> 22 September 2025
|
|
22
|
-
|
|
23
20
|
- Add support for ticket events from the engine [`#693`](https://github.com/nyaruka/temba-components/pull/693)
|
|
24
21
|
- First draft for rules editor [`#691`](https://github.com/nyaruka/temba-components/pull/691)
|
|
25
22
|
- Show contact ref on details tab since it might be hidden by name if set [`#690`](https://github.com/nyaruka/temba-components/pull/690)
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Sortable Rules Demo</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: Arial, sans-serif;
|
|
10
|
+
max-width: 800px;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
}
|
|
14
|
+
.demo-section {
|
|
15
|
+
margin: 20px 0;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
border: 1px solid #ddd;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<h1>Sortable Rules Demo</h1>
|
|
24
|
+
|
|
25
|
+
<div class="demo-section">
|
|
26
|
+
<h2>Sortable Array Editor</h2>
|
|
27
|
+
<p>
|
|
28
|
+
This demonstrates sortable functionality in array editor with drag and
|
|
29
|
+
drop support:
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<temba-array-editor
|
|
33
|
+
itemLabel="Rule"
|
|
34
|
+
sortable="true"
|
|
35
|
+
maintainEmptyItem="true"
|
|
36
|
+
></temba-array-editor>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
// Set up the array editor with initial data and item config
|
|
40
|
+
const arrayEditor = document.querySelector('temba-array-editor');
|
|
41
|
+
|
|
42
|
+
arrayEditor.itemConfig = {
|
|
43
|
+
operator: {
|
|
44
|
+
type: 'select',
|
|
45
|
+
required: true,
|
|
46
|
+
multi: false,
|
|
47
|
+
options: [
|
|
48
|
+
{ value: 'has_any_word', name: 'has any of the words' },
|
|
49
|
+
{ value: 'has_phrase', name: 'has the phrase' },
|
|
50
|
+
{ value: 'has_only_phrase', name: 'has only the phrase' },
|
|
51
|
+
{ value: 'has_number', name: 'has a number' },
|
|
52
|
+
{ value: 'has_number_lt', name: 'has a number below' },
|
|
53
|
+
{ value: 'has_number_eq', name: 'has a number equal to' },
|
|
54
|
+
{ value: 'has_number_gt', name: 'has a number above' }
|
|
55
|
+
],
|
|
56
|
+
flavor: 'xsmall',
|
|
57
|
+
width: '200px'
|
|
58
|
+
},
|
|
59
|
+
value1: {
|
|
60
|
+
type: 'text',
|
|
61
|
+
flavor: 'xsmall'
|
|
62
|
+
},
|
|
63
|
+
category: {
|
|
64
|
+
type: 'text',
|
|
65
|
+
placeholder: 'Category',
|
|
66
|
+
required: true,
|
|
67
|
+
maxWidth: '120px',
|
|
68
|
+
flavor: 'xsmall'
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
arrayEditor.value = [
|
|
73
|
+
{
|
|
74
|
+
operator: { value: 'has_any_word', name: 'has any of the words' },
|
|
75
|
+
value1: 'yes sure',
|
|
76
|
+
category: 'Yes'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
operator: { value: 'has_any_word', name: 'has any of the words' },
|
|
80
|
+
value1: 'no never',
|
|
81
|
+
category: 'No'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
operator: { value: 'has_number', name: 'has a number' },
|
|
85
|
+
value1: '',
|
|
86
|
+
category: 'Numbers'
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
arrayEditor.addEventListener('change', (e) => {
|
|
91
|
+
console.log('Array changed:', e.detail.value);
|
|
92
|
+
});
|
|
93
|
+
</script>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class="demo-section">
|
|
97
|
+
<h2>Non-Sortable Array Editor (for comparison)</h2>
|
|
98
|
+
<p>This is the same array editor without sortable functionality:</p>
|
|
99
|
+
|
|
100
|
+
<temba-array-editor
|
|
101
|
+
itemLabel="Rule"
|
|
102
|
+
sortable="false"
|
|
103
|
+
maintainEmptyItem="true"
|
|
104
|
+
></temba-array-editor>
|
|
105
|
+
|
|
106
|
+
<script>
|
|
107
|
+
// Set up the non-sortable array editor
|
|
108
|
+
const nonSortableEditor =
|
|
109
|
+
document.querySelectorAll('temba-array-editor')[1];
|
|
110
|
+
|
|
111
|
+
nonSortableEditor.itemConfig = {
|
|
112
|
+
operator: {
|
|
113
|
+
type: 'select',
|
|
114
|
+
required: true,
|
|
115
|
+
multi: false,
|
|
116
|
+
options: [
|
|
117
|
+
{ value: 'has_any_word', name: 'has any of the words' },
|
|
118
|
+
{ value: 'has_phrase', name: 'has the phrase' },
|
|
119
|
+
{ value: 'has_only_phrase', name: 'has only the phrase' },
|
|
120
|
+
{ value: 'has_number', name: 'has a number' }
|
|
121
|
+
],
|
|
122
|
+
flavor: 'xsmall',
|
|
123
|
+
width: '200px'
|
|
124
|
+
},
|
|
125
|
+
value1: {
|
|
126
|
+
type: 'text',
|
|
127
|
+
flavor: 'xsmall'
|
|
128
|
+
},
|
|
129
|
+
category: {
|
|
130
|
+
type: 'text',
|
|
131
|
+
placeholder: 'Category',
|
|
132
|
+
required: true,
|
|
133
|
+
maxWidth: '120px',
|
|
134
|
+
flavor: 'xsmall'
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
nonSortableEditor.value = [
|
|
139
|
+
{
|
|
140
|
+
operator: { value: 'has_any_word', name: 'has any of the words' },
|
|
141
|
+
value1: 'yes sure',
|
|
142
|
+
category: 'Yes'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
operator: { value: 'has_any_word', name: 'has any of the words' },
|
|
146
|
+
value1: 'no never',
|
|
147
|
+
category: 'No'
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
</script>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<script type="module" src="../src/temba-components.js"></script>
|
|
154
|
+
</body>
|
|
155
|
+
</html>
|