@nyaruka/temba-components 0.129.6 → 0.129.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 +11 -4
- package/.devcontainer/devcontainer.json +3 -2
- package/.github/workflows/build.yml +4 -14
- package/CHANGELOG.md +25 -1
- package/demo/components/flow/example.html +9 -2
- package/demo/components/flow/index.html +206 -0
- package/demo/components/message-editor/example.html +125 -0
- package/demo/components/textinput/completion.html +1 -0
- package/demo/data/flows/food-order.json +132 -0
- package/demo/data/flows/sample-flow.json +40 -24
- package/demo/index.html +1 -1
- package/dist/temba-components.js +518 -220
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/Thumbnail.js +2 -1
- package/out-tsc/src/display/Thumbnail.js.map +1 -1
- package/out-tsc/src/events.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +10 -2
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +245 -22
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/StickyNote.js +1 -1
- package/out-tsc/src/flow/StickyNote.js.map +1 -1
- package/out-tsc/src/flow/actions/call_webhook.js +26 -17
- package/out-tsc/src/flow/actions/call_webhook.js.map +1 -1
- package/out-tsc/src/flow/actions/send_email.js +1 -2
- package/out-tsc/src/flow/actions/send_email.js.map +1 -1
- package/out-tsc/src/flow/actions/send_msg.js +155 -7
- package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +111 -38
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/BaseListEditor.js +19 -4
- package/out-tsc/src/form/BaseListEditor.js.map +1 -1
- package/out-tsc/src/form/FormField.js +1 -1
- package/out-tsc/src/form/FormField.js.map +1 -1
- package/out-tsc/src/form/KeyValueEditor.js +1 -1
- package/out-tsc/src/form/KeyValueEditor.js.map +1 -1
- package/out-tsc/src/form/MediaPicker.js +13 -1
- package/out-tsc/src/form/MediaPicker.js.map +1 -1
- package/out-tsc/src/form/MessageEditor.js +422 -0
- package/out-tsc/src/form/MessageEditor.js.map +1 -0
- package/out-tsc/src/form/TextInput.js +12 -5
- package/out-tsc/src/form/TextInput.js.map +1 -1
- package/out-tsc/src/form/select/Select.js +4 -4
- package/out-tsc/src/form/select/Select.js.map +1 -1
- package/out-tsc/src/live/ContactChat.js +29 -4
- package/out-tsc/src/live/ContactChat.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-field-config.test.js +4 -2
- package/out-tsc/test/temba-field-config.test.js.map +1 -1
- package/out-tsc/test/temba-message-editor.test.js +194 -0
- package/out-tsc/test/temba-message-editor.test.js.map +1 -0
- package/out-tsc/test/temba-node-editor.test.js +71 -0
- package/out-tsc/test/temba-node-editor.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +1 -1
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/temba-textinput.test.js +16 -0
- package/out-tsc/test/temba-textinput.test.js.map +1 -1
- package/out-tsc/test/temba-webchat.test.js +4 -0
- package/out-tsc/test/temba-webchat.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +2 -8
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +7 -4
- package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/single-group.png +0 -0
- 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/editor/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/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/editor/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/with-expressions.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/long-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/editor/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.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/send_msg.png +0 -0
- package/screenshots/truth/editor/set_contact_language.png +0 -0
- package/screenshots/truth/editor/set_contact_name.png +0 -0
- package/screenshots/truth/editor/set_run_result.png +0 -0
- package/screenshots/truth/formfield/markdown-errors.png +0 -0
- package/screenshots/truth/formfield/no-errors.png +0 -0
- package/screenshots/truth/formfield/plain-text-errors.png +0 -0
- package/screenshots/truth/message-editor/autogrow-initial-content.png +0 -0
- package/screenshots/truth/message-editor/default.png +0 -0
- package/screenshots/truth/message-editor/drag-highlight.png +0 -0
- package/screenshots/truth/message-editor/filtered-attachments.png +0 -0
- package/screenshots/truth/message-editor/with-completion.png +0 -0
- package/screenshots/truth/message-editor/with-properties.png +0 -0
- package/screenshots/truth/sticky-note/blue-color.png +0 -0
- package/screenshots/truth/sticky-note/blue.png +0 -0
- package/screenshots/truth/sticky-note/color-picker-expanded.png +0 -0
- package/screenshots/truth/sticky-note/default.png +0 -0
- package/screenshots/truth/sticky-note/gray-color.png +0 -0
- package/screenshots/truth/sticky-note/gray.png +0 -0
- package/screenshots/truth/sticky-note/green-color.png +0 -0
- package/screenshots/truth/sticky-note/green.png +0 -0
- package/screenshots/truth/sticky-note/pink-color.png +0 -0
- package/screenshots/truth/sticky-note/pink.png +0 -0
- package/screenshots/truth/sticky-note/yellow-color.png +0 -0
- package/screenshots/truth/sticky-note/yellow.png +0 -0
- package/screenshots/truth/textinput/autogrow-initial.png +0 -0
- package/screenshots/truth/textinput/input-form.png +0 -0
- package/src/display/Thumbnail.ts +2 -1
- package/src/events.ts +6 -2
- package/src/flow/CanvasNode.ts +10 -2
- package/src/flow/NodeEditor.ts +269 -23
- package/src/flow/StickyNote.ts +1 -1
- package/src/flow/actions/call_webhook.ts +28 -18
- package/src/flow/actions/send_email.ts +1 -2
- package/src/flow/actions/send_msg.ts +178 -7
- package/src/flow/types.ts +21 -2
- package/src/form/ArrayEditor.ts +120 -42
- package/src/form/BaseListEditor.ts +22 -6
- package/src/form/FormField.ts +1 -1
- package/src/form/KeyValueEditor.ts +1 -1
- package/src/form/MediaPicker.ts +13 -1
- package/src/form/MessageEditor.ts +449 -0
- package/src/form/TextInput.ts +15 -7
- package/src/form/select/Select.ts +4 -4
- package/src/live/ContactChat.ts +32 -6
- package/src/store/flow-definition.d.ts +25 -4
- package/static/css/temba-components.css +2 -0
- package/static/mr/docs/en-us/editor.json +2588 -0
- package/stress-test.js +138 -0
- package/temba-modules.ts +2 -0
- package/test/temba-field-config.test.ts +4 -2
- package/test/temba-message-editor.test.ts +300 -0
- package/test/temba-node-editor.test.ts +94 -0
- package/test/temba-select.test.ts +1 -1
- package/test/temba-textinput.test.ts +26 -0
- package/test/temba-webchat.test.ts +5 -0
- package/test/utils.test.ts +2 -13
- package/test-assets/contacts/history.json +20 -2
- package/test-assets/style.css +2 -0
- package/web-dev-mock.mjs +433 -0
- package/web-dev-server.config.mjs +71 -6
- package/web-test-runner.config.mjs +9 -4
|
@@ -10,17 +10,27 @@
|
|
|
10
10
|
"uuid": "a229fa3c-16bb-440b-9ae8-b7ee7a723f44",
|
|
11
11
|
"actions": [
|
|
12
12
|
{
|
|
13
|
+
"uuid": "3d56e4cf-1e88-499a-b0b4-ff48385fc9a5",
|
|
14
|
+
"type": "send_msg",
|
|
15
|
+
"text": "What is your favorite color?! @contact.uuid. It works.",
|
|
13
16
|
"attachments": [
|
|
14
|
-
"image:http://
|
|
17
|
+
"image/jpeg:http://localhost:9000/temba-attachments/c4e84ebf-fdd7-439b-a2ca-aeb5e54dfc1d-IMG_3245.jpeg",
|
|
18
|
+
"image/jpeg:http://localhost:9000/temba-attachments/e7d4d3cd-ec89-45c2-bc0b-4f652f1f7fde-IMG_3262.jpeg",
|
|
19
|
+
"image/jpeg:http://localhost:9000/temba-attachments/ae831575-0d23-40b7-ae0c-531b8775a6bc-IMG_3282.jpeg",
|
|
20
|
+
"image/jpeg:http://localhost:9000/temba-attachments/837ac13b-e524-4a4c-9385-81873c5df138-IMG_3290.jpeg",
|
|
21
|
+
"image/jpeg:http://localhost:9000/temba-attachments/761e6345-3a19-49da-8a53-5c772d7739bc-IMG_3339.jpeg",
|
|
22
|
+
"image/jpeg:http://localhost:9000/temba-attachments/ea6b336d-4389-4d32-b58a-e5a138d13c84-IMG_3237.jpeg"
|
|
15
23
|
],
|
|
16
|
-
"text": "What is your favorite color?",
|
|
17
|
-
"type": "send_msg",
|
|
18
24
|
"quick_replies": [
|
|
19
25
|
"Red",
|
|
20
26
|
"Green",
|
|
21
|
-
"Blue"
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
"Blue",
|
|
28
|
+
"Yellow",
|
|
29
|
+
"Purple",
|
|
30
|
+
"@contact.first_name",
|
|
31
|
+
"@contact.uuid",
|
|
32
|
+
"@contact.last_name"
|
|
33
|
+
]
|
|
24
34
|
}
|
|
25
35
|
],
|
|
26
36
|
"exits": [
|
|
@@ -135,7 +145,7 @@
|
|
|
135
145
|
"Content-Type": "application/json",
|
|
136
146
|
"Authorization": "Bearer token here"
|
|
137
147
|
},
|
|
138
|
-
"body": "@(json(object(\n \"contact\", object(\n \"uuid\", contact.uuid, \n \"name\", contact.name, \n \"urn\", contact.urn\n ),\n \"flow\", object(\n \"uuid\", run.flow.uuid, \n \"name\", run.flow.name\n ),\n \"results\", foreach_value(results, extract_object, \"value\", \"category\")\n)))"
|
|
148
|
+
"body": "@(json(object(\n \"contact\", object(\n \"uuid\", contact.uuid, \n \"name\", contact.name, \n \"urn\", contact.urn\n ),\n \"flow\", object(\n \"uuid\", run.flow.uuid, \n \"name\", run.flow.name\n ),\n \"results\", foreach_value(results, extract_object, \"value\", \"category\")\n)))ast"
|
|
139
149
|
}
|
|
140
150
|
],
|
|
141
151
|
"router": {
|
|
@@ -185,9 +195,15 @@
|
|
|
185
195
|
"uuid": "9963160a-a007-4c7b-8c9e-7325e1b69ed8",
|
|
186
196
|
"type": "send_msg",
|
|
187
197
|
"text": "Excellent choices.",
|
|
198
|
+
"attachments": [
|
|
199
|
+
"audio:http://arst",
|
|
200
|
+
"image:@contact.first_name"
|
|
201
|
+
],
|
|
188
202
|
"quick_replies": [
|
|
189
|
-
"
|
|
190
|
-
"
|
|
203
|
+
"Red",
|
|
204
|
+
"Green",
|
|
205
|
+
"Blue",
|
|
206
|
+
"@contact.name"
|
|
191
207
|
]
|
|
192
208
|
},
|
|
193
209
|
{
|
|
@@ -798,7 +814,7 @@
|
|
|
798
814
|
"nodes": {
|
|
799
815
|
"a229fa3c-16bb-440b-9ae8-b7ee7a723f44": {
|
|
800
816
|
"position": {
|
|
801
|
-
"left":
|
|
817
|
+
"left": 240,
|
|
802
818
|
"top": 0
|
|
803
819
|
},
|
|
804
820
|
"type": "execute_actions"
|
|
@@ -806,8 +822,8 @@
|
|
|
806
822
|
"ef1a5b06-1331-4c0d-9f46-58b1e5baf671": {
|
|
807
823
|
"type": "wait_for_response",
|
|
808
824
|
"position": {
|
|
809
|
-
"left":
|
|
810
|
-
"top":
|
|
825
|
+
"left": 220,
|
|
826
|
+
"top": 260
|
|
811
827
|
},
|
|
812
828
|
"config": {
|
|
813
829
|
"cases": {}
|
|
@@ -816,15 +832,15 @@
|
|
|
816
832
|
"e1f22e97-a170-44b4-a79b-98ab916f4c34": {
|
|
817
833
|
"type": "split_by_webhook",
|
|
818
834
|
"position": {
|
|
819
|
-
"left":
|
|
820
|
-
"top":
|
|
835
|
+
"left": 700,
|
|
836
|
+
"top": 20
|
|
821
837
|
},
|
|
822
838
|
"config": {}
|
|
823
839
|
},
|
|
824
840
|
"4efc49e0-ebfe-454d-a1a0-900a911dd5ef": {
|
|
825
841
|
"position": {
|
|
826
|
-
"left":
|
|
827
|
-
"top":
|
|
842
|
+
"left": 220,
|
|
843
|
+
"top": 440
|
|
828
844
|
},
|
|
829
845
|
"type": "execute_actions"
|
|
830
846
|
},
|
|
@@ -887,8 +903,8 @@
|
|
|
887
903
|
"5f1394c1-4b8c-4357-8863-db24817b2aa3": {
|
|
888
904
|
"type": "split_by_groups",
|
|
889
905
|
"position": {
|
|
890
|
-
"left":
|
|
891
|
-
"top":
|
|
906
|
+
"left": 520,
|
|
907
|
+
"top": 380
|
|
892
908
|
},
|
|
893
909
|
"config": {
|
|
894
910
|
"cases": {}
|
|
@@ -907,14 +923,14 @@
|
|
|
907
923
|
"3dfe9cf2-72d1-496f-8d20-d5743af0f9c8": {
|
|
908
924
|
"type": "split_by_llm",
|
|
909
925
|
"position": {
|
|
910
|
-
"left":
|
|
911
|
-
"top":
|
|
926
|
+
"left": 520,
|
|
927
|
+
"top": 1020
|
|
912
928
|
},
|
|
913
929
|
"config": {}
|
|
914
930
|
},
|
|
915
931
|
"425c4757-bead-440f-92aa-a1cc3fcd7d35": {
|
|
916
932
|
"position": {
|
|
917
|
-
"left":
|
|
933
|
+
"left": 760,
|
|
918
934
|
"top": 840
|
|
919
935
|
},
|
|
920
936
|
"type": "execute_actions"
|
|
@@ -922,8 +938,8 @@
|
|
|
922
938
|
"21ff86c2-5276-4448-afb6-54d1f832ba0c": {
|
|
923
939
|
"type": "split_by_ticket",
|
|
924
940
|
"position": {
|
|
925
|
-
"left":
|
|
926
|
-
"top":
|
|
941
|
+
"left": 820,
|
|
942
|
+
"top": 980
|
|
927
943
|
},
|
|
928
944
|
"config": {}
|
|
929
945
|
}
|
|
@@ -950,7 +966,7 @@
|
|
|
950
966
|
"598a87e4-f20b-48ba-aac5-bb365d8f1501": {
|
|
951
967
|
"position": {
|
|
952
968
|
"left": 0,
|
|
953
|
-
"top":
|
|
969
|
+
"top": 780
|
|
954
970
|
},
|
|
955
971
|
"title": "Green Note",
|
|
956
972
|
"body": "They also come in green, do I like them better? Maybe I do. There is a standard height, they will have to get used to it.",
|
package/demo/index.html
CHANGED
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
A work in progress editor for RapidPro flows to replace existing
|
|
176
176
|
react editor.
|
|
177
177
|
</p>
|
|
178
|
-
<a href="components/flow/
|
|
178
|
+
<a href="components/flow/index.html">Examples</a>
|
|
179
179
|
</div>
|
|
180
180
|
|
|
181
181
|
<div class="component-card">
|