@nyaruka/temba-components 0.86.1 → 0.87.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.
Files changed (282) hide show
  1. package/.eslintrc.js +3 -3
  2. package/.prettierrc +6 -0
  3. package/.storybook/main.js +3 -3
  4. package/.storybook/preview.js +2 -2
  5. package/CHANGELOG.md +15 -24
  6. package/CreateIncludesPlugin.js +2 -2
  7. package/demo/index.html +1 -0
  8. package/dist/locales/es.js +1 -1
  9. package/dist/locales/es.js.map +1 -1
  10. package/dist/locales/fr.js +1 -1
  11. package/dist/locales/fr.js.map +1 -1
  12. package/dist/locales/pt.js +1 -1
  13. package/dist/locales/pt.js.map +1 -1
  14. package/dist/temba-components.js +296 -277
  15. package/dist/temba-components.js.map +1 -1
  16. package/out-tsc/src/RapidElement.js +3 -3
  17. package/out-tsc/src/RapidElement.js.map +1 -1
  18. package/out-tsc/src/ResizeElement.js +2 -2
  19. package/out-tsc/src/ResizeElement.js.map +1 -1
  20. package/out-tsc/src/aliaseditor/AliasEditor.js +1 -1
  21. package/out-tsc/src/aliaseditor/AliasEditor.js.map +1 -1
  22. package/out-tsc/src/button/Button.js +1 -1
  23. package/out-tsc/src/button/Button.js.map +1 -1
  24. package/out-tsc/src/charcount/helpers.js +1 -1
  25. package/out-tsc/src/charcount/helpers.js.map +1 -1
  26. package/out-tsc/src/colorpicker/ColorPicker.js +4 -4
  27. package/out-tsc/src/colorpicker/ColorPicker.js.map +1 -1
  28. package/out-tsc/src/completion/Completion.js +2 -2
  29. package/out-tsc/src/completion/Completion.js.map +1 -1
  30. package/out-tsc/src/completion/ExcellentParser.js +1 -1
  31. package/out-tsc/src/completion/ExcellentParser.js.map +1 -1
  32. package/out-tsc/src/completion/helpers.js +8 -8
  33. package/out-tsc/src/completion/helpers.js.map +1 -1
  34. package/out-tsc/src/compose/Compose.js +14 -14
  35. package/out-tsc/src/compose/Compose.js.map +1 -1
  36. package/out-tsc/src/contacts/ContactBadges.js +2 -2
  37. package/out-tsc/src/contacts/ContactBadges.js.map +1 -1
  38. package/out-tsc/src/contacts/ContactChat.js +4 -4
  39. package/out-tsc/src/contacts/ContactChat.js.map +1 -1
  40. package/out-tsc/src/contacts/ContactDetails.js +4 -4
  41. package/out-tsc/src/contacts/ContactDetails.js.map +1 -1
  42. package/out-tsc/src/contacts/ContactFieldEditor.js +3 -3
  43. package/out-tsc/src/contacts/ContactFieldEditor.js.map +1 -1
  44. package/out-tsc/src/contacts/ContactFields.js +2 -2
  45. package/out-tsc/src/contacts/ContactFields.js.map +1 -1
  46. package/out-tsc/src/contacts/ContactHistory.js +21 -19
  47. package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
  48. package/out-tsc/src/contacts/ContactPending.js +4 -4
  49. package/out-tsc/src/contacts/ContactPending.js.map +1 -1
  50. package/out-tsc/src/contacts/ContactTickets.js +8 -8
  51. package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
  52. package/out-tsc/src/contacts/events.js +2 -2
  53. package/out-tsc/src/contacts/events.js.map +1 -1
  54. package/out-tsc/src/contacts/helpers.js +2 -2
  55. package/out-tsc/src/contacts/helpers.js.map +1 -1
  56. package/out-tsc/src/contactsearch/ContactSearch.js +7 -7
  57. package/out-tsc/src/contactsearch/ContactSearch.js.map +1 -1
  58. package/out-tsc/src/date/TembaDate.js +1 -1
  59. package/out-tsc/src/date/TembaDate.js.map +1 -1
  60. package/out-tsc/src/datepicker/DatePicker.js +1 -1
  61. package/out-tsc/src/datepicker/DatePicker.js.map +1 -1
  62. package/out-tsc/src/dialog/Dialog.js +5 -5
  63. package/out-tsc/src/dialog/Dialog.js.map +1 -1
  64. package/out-tsc/src/dialog/Modax.js +8 -8
  65. package/out-tsc/src/dialog/Modax.js.map +1 -1
  66. package/out-tsc/src/dropdown/Dropdown.js +1 -1
  67. package/out-tsc/src/dropdown/Dropdown.js.map +1 -1
  68. package/out-tsc/src/fields/FieldManager.js +6 -6
  69. package/out-tsc/src/fields/FieldManager.js.map +1 -1
  70. package/out-tsc/src/imagepicker/ImagePicker.js +4 -4
  71. package/out-tsc/src/imagepicker/ImagePicker.js.map +1 -1
  72. package/out-tsc/src/interfaces.js.map +1 -1
  73. package/out-tsc/src/label/Label.js +1 -1
  74. package/out-tsc/src/label/Label.js.map +1 -1
  75. package/out-tsc/src/leafletmap/LeafletMap.js +6 -6
  76. package/out-tsc/src/leafletmap/LeafletMap.js.map +1 -1
  77. package/out-tsc/src/leafletmap/helpers.js +2 -2
  78. package/out-tsc/src/leafletmap/helpers.js.map +1 -1
  79. package/out-tsc/src/lightbox/Lightbox.js +2 -2
  80. package/out-tsc/src/lightbox/Lightbox.js.map +1 -1
  81. package/out-tsc/src/list/ContentMenu.js +8 -8
  82. package/out-tsc/src/list/ContentMenu.js.map +1 -1
  83. package/out-tsc/src/list/RunList.js +1 -1
  84. package/out-tsc/src/list/RunList.js.map +1 -1
  85. package/out-tsc/src/list/SortableList.js +6 -6
  86. package/out-tsc/src/list/SortableList.js.map +1 -1
  87. package/out-tsc/src/list/TembaList.js +5 -5
  88. package/out-tsc/src/list/TembaList.js.map +1 -1
  89. package/out-tsc/src/list/TembaMenu.js +22 -22
  90. package/out-tsc/src/list/TembaMenu.js.map +1 -1
  91. package/out-tsc/src/loading/Loading.js +1 -1
  92. package/out-tsc/src/loading/Loading.js.map +1 -1
  93. package/out-tsc/src/locales/es.js +1 -1
  94. package/out-tsc/src/locales/es.js.map +1 -1
  95. package/out-tsc/src/locales/fr.js +1 -1
  96. package/out-tsc/src/locales/fr.js.map +1 -1
  97. package/out-tsc/src/locales/pt.js +1 -1
  98. package/out-tsc/src/locales/pt.js.map +1 -1
  99. package/out-tsc/src/omnibox/Omnibox.js +1 -1
  100. package/out-tsc/src/omnibox/Omnibox.js.map +1 -1
  101. package/out-tsc/src/options/Options.js +9 -9
  102. package/out-tsc/src/options/Options.js.map +1 -1
  103. package/out-tsc/src/remote/Remote.js +1 -1
  104. package/out-tsc/src/remote/Remote.js.map +1 -1
  105. package/out-tsc/src/select/Select.js +18 -18
  106. package/out-tsc/src/select/Select.js.map +1 -1
  107. package/out-tsc/src/sms/gsmsplitter.js +8 -8
  108. package/out-tsc/src/sms/gsmsplitter.js.map +1 -1
  109. package/out-tsc/src/sms/gsmvalidator.js +1 -1
  110. package/out-tsc/src/sms/gsmvalidator.js.map +1 -1
  111. package/out-tsc/src/sms/index.js +2 -2
  112. package/out-tsc/src/sms/index.js.map +1 -1
  113. package/out-tsc/src/sms/unicodesplitter.js +8 -8
  114. package/out-tsc/src/sms/unicodesplitter.js.map +1 -1
  115. package/out-tsc/src/store/Store.js +10 -10
  116. package/out-tsc/src/store/Store.js.map +1 -1
  117. package/out-tsc/src/store/StoreElement.js +2 -2
  118. package/out-tsc/src/store/StoreElement.js.map +1 -1
  119. package/out-tsc/src/tabpane/TabPane.js +4 -4
  120. package/out-tsc/src/tabpane/TabPane.js.map +1 -1
  121. package/out-tsc/src/templates/TemplateEditor.js +9 -9
  122. package/out-tsc/src/templates/TemplateEditor.js.map +1 -1
  123. package/out-tsc/src/textinput/TextInput.js +1 -1
  124. package/out-tsc/src/textinput/TextInput.js.map +1 -1
  125. package/out-tsc/src/thumbnail/Thumbnail.js +5 -5
  126. package/out-tsc/src/thumbnail/Thumbnail.js.map +1 -1
  127. package/out-tsc/src/tip/Tip.js +3 -3
  128. package/out-tsc/src/tip/Tip.js.map +1 -1
  129. package/out-tsc/src/utils/index.js +21 -21
  130. package/out-tsc/src/utils/index.js.map +1 -1
  131. package/out-tsc/src/vectoricon/VectorIcon.js +2 -2
  132. package/out-tsc/src/vectoricon/VectorIcon.js.map +1 -1
  133. package/out-tsc/src/vectoricon/index.js +1 -0
  134. package/out-tsc/src/vectoricon/index.js.map +1 -1
  135. package/out-tsc/src/webchat/WebChat.js +234 -81
  136. package/out-tsc/src/webchat/WebChat.js.map +1 -1
  137. package/out-tsc/src/webchat/assets.js +2 -0
  138. package/out-tsc/src/webchat/assets.js.map +1 -0
  139. package/out-tsc/src/webchat/index.js.map +1 -1
  140. package/out-tsc/test/temba-alert.test.js +1 -1
  141. package/out-tsc/test/temba-alert.test.js.map +1 -1
  142. package/out-tsc/test/temba-checkbox.test.js.map +1 -1
  143. package/out-tsc/test/temba-color-picker.test.js +4 -4
  144. package/out-tsc/test/temba-color-picker.test.js.map +1 -1
  145. package/out-tsc/test/temba-compose.test.js +50 -54
  146. package/out-tsc/test/temba-compose.test.js.map +1 -1
  147. package/out-tsc/test/temba-contact-badges.test.js +2 -2
  148. package/out-tsc/test/temba-contact-badges.test.js.map +1 -1
  149. package/out-tsc/test/temba-contact-chat.test.js +25 -38
  150. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  151. package/out-tsc/test/temba-contact-details.test.js +2 -2
  152. package/out-tsc/test/temba-contact-details.test.js.map +1 -1
  153. package/out-tsc/test/temba-contact-fields.test.js +4 -4
  154. package/out-tsc/test/temba-contact-fields.test.js.map +1 -1
  155. package/out-tsc/test/temba-contact-history.test.js +3 -3
  156. package/out-tsc/test/temba-contact-history.test.js.map +1 -1
  157. package/out-tsc/test/temba-contact-search.test.js +7 -7
  158. package/out-tsc/test/temba-contact-search.test.js.map +1 -1
  159. package/out-tsc/test/temba-contact-tickets.test.js +3 -3
  160. package/out-tsc/test/temba-contact-tickets.test.js.map +1 -1
  161. package/out-tsc/test/temba-content-menu.test.js +7 -7
  162. package/out-tsc/test/temba-content-menu.test.js.map +1 -1
  163. package/out-tsc/test/temba-date.test.js +3 -3
  164. package/out-tsc/test/temba-date.test.js.map +1 -1
  165. package/out-tsc/test/temba-datepicker.test.js +1 -1
  166. package/out-tsc/test/temba-datepicker.test.js.map +1 -1
  167. package/out-tsc/test/temba-field-manager.test.js +1 -3
  168. package/out-tsc/test/temba-field-manager.test.js.map +1 -1
  169. package/out-tsc/test/temba-label.test.js +6 -6
  170. package/out-tsc/test/temba-label.test.js.map +1 -1
  171. package/out-tsc/test/temba-lightbox.test.js +2 -2
  172. package/out-tsc/test/temba-lightbox.test.js.map +1 -1
  173. package/out-tsc/test/temba-list.test.js +6 -6
  174. package/out-tsc/test/temba-list.test.js.map +1 -1
  175. package/out-tsc/test/temba-menu.test.js +4 -5
  176. package/out-tsc/test/temba-menu.test.js.map +1 -1
  177. package/out-tsc/test/temba-modax.test.js +3 -3
  178. package/out-tsc/test/temba-modax.test.js.map +1 -1
  179. package/out-tsc/test/temba-options.test.js +1 -1
  180. package/out-tsc/test/temba-options.test.js.map +1 -1
  181. package/out-tsc/test/temba-select.test.js +17 -17
  182. package/out-tsc/test/temba-select.test.js.map +1 -1
  183. package/out-tsc/test/temba-sortable-list.test.js +1 -1
  184. package/out-tsc/test/temba-sortable-list.test.js.map +1 -1
  185. package/out-tsc/test/temba-textinput.test.js +2 -2
  186. package/out-tsc/test/temba-textinput.test.js.map +1 -1
  187. package/out-tsc/test/temba-tip.test.js +4 -4
  188. package/out-tsc/test/temba-tip.test.js.map +1 -1
  189. package/out-tsc/test/utils.test.js +8 -8
  190. package/out-tsc/test/utils.test.js.map +1 -1
  191. package/package.json +6 -15
  192. package/src/RapidElement.ts +3 -3
  193. package/src/ResizeElement.ts +2 -2
  194. package/src/aliaseditor/AliasEditor.ts +1 -2
  195. package/src/button/Button.ts +1 -1
  196. package/src/charcount/helpers.ts +1 -1
  197. package/src/colorpicker/ColorPicker.ts +4 -4
  198. package/src/completion/Completion.ts +2 -2
  199. package/src/completion/ExcellentParser.ts +1 -1
  200. package/src/completion/helpers.ts +9 -9
  201. package/src/compose/Compose.ts +18 -16
  202. package/src/contacts/ContactBadges.ts +2 -2
  203. package/src/contacts/ContactChat.ts +4 -4
  204. package/src/contacts/ContactDetails.ts +4 -4
  205. package/src/contacts/ContactFieldEditor.ts +4 -4
  206. package/src/contacts/ContactFields.ts +2 -2
  207. package/src/contacts/ContactHistory.ts +25 -22
  208. package/src/contacts/ContactPending.ts +4 -4
  209. package/src/contacts/ContactTickets.ts +9 -9
  210. package/src/contacts/events.ts +3 -3
  211. package/src/contacts/helpers.ts +2 -2
  212. package/src/contactsearch/ContactSearch.ts +9 -9
  213. package/src/date/TembaDate.ts +1 -1
  214. package/src/datepicker/DatePicker.ts +1 -1
  215. package/src/dialog/Dialog.ts +6 -6
  216. package/src/dialog/Modax.ts +8 -8
  217. package/src/dropdown/Dropdown.ts +1 -2
  218. package/src/emojis.json +1882 -1
  219. package/src/fields/FieldManager.ts +6 -7
  220. package/src/imagepicker/ImagePicker.ts +4 -4
  221. package/src/interfaces.ts +4 -4
  222. package/src/label/Label.ts +1 -1
  223. package/src/leafletmap/LeafletMap.ts +6 -6
  224. package/src/leafletmap/helpers.ts +2 -2
  225. package/src/lightbox/Lightbox.ts +2 -2
  226. package/src/list/ContentMenu.ts +9 -9
  227. package/src/list/RunList.ts +1 -1
  228. package/src/list/SortableList.ts +6 -6
  229. package/src/list/TembaList.ts +5 -5
  230. package/src/list/TembaMenu.ts +23 -23
  231. package/src/loading/Loading.ts +1 -1
  232. package/src/locales/es.ts +1 -1
  233. package/src/locales/fr.ts +1 -1
  234. package/src/locales/pt.ts +1 -1
  235. package/src/omnibox/Omnibox.ts +2 -2
  236. package/src/options/Options.ts +9 -9
  237. package/src/remote/Remote.ts +1 -1
  238. package/src/select/Select.ts +19 -19
  239. package/src/sms/gsmsplitter.ts +8 -8
  240. package/src/sms/gsmvalidator.ts +1 -1
  241. package/src/sms/index.ts +2 -2
  242. package/src/sms/unicodesplitter.ts +8 -8
  243. package/src/store/Store.ts +10 -10
  244. package/src/store/StoreElement.ts +2 -2
  245. package/src/tabpane/TabPane.ts +4 -4
  246. package/src/templates/TemplateEditor.ts +9 -9
  247. package/src/textinput/TextInput.ts +2 -2
  248. package/src/thumbnail/Thumbnail.ts +5 -5
  249. package/src/tip/Tip.ts +3 -3
  250. package/src/utils/index.ts +24 -24
  251. package/src/vectoricon/VectorIcon.ts +2 -2
  252. package/src/vectoricon/index.ts +2 -1
  253. package/src/webchat/WebChat.ts +272 -87
  254. package/src/webchat/assets.ts +2 -0
  255. package/src/webchat/index.ts +1 -1
  256. package/svg.js +28 -29
  257. package/test/temba-alert.test.ts +1 -1
  258. package/test/temba-checkbox.test.ts +1 -1
  259. package/test/temba-color-picker.test.ts +4 -4
  260. package/test/temba-compose.test.ts +50 -55
  261. package/test/temba-contact-badges.test.ts +2 -2
  262. package/test/temba-contact-chat.test.ts +26 -46
  263. package/test/temba-contact-details.test.ts +2 -8
  264. package/test/temba-contact-fields.test.ts +4 -11
  265. package/test/temba-contact-history.test.ts +3 -3
  266. package/test/temba-contact-search.test.ts +7 -13
  267. package/test/temba-contact-tickets.test.ts +3 -3
  268. package/test/temba-content-menu.test.ts +7 -7
  269. package/test/temba-date.test.ts +3 -3
  270. package/test/temba-datepicker.test.ts +1 -1
  271. package/test/temba-field-manager.test.ts +1 -4
  272. package/test/temba-label.test.ts +6 -6
  273. package/test/temba-lightbox.test.ts +2 -2
  274. package/test/temba-list.test.ts +6 -6
  275. package/test/temba-menu.test.ts +4 -5
  276. package/test/temba-modax.test.ts +3 -3
  277. package/test/temba-options.test.ts +1 -1
  278. package/test/temba-select.test.ts +17 -17
  279. package/test/temba-sortable-list.test.ts +1 -1
  280. package/test/temba-textinput.test.ts +2 -2
  281. package/test/temba-tip.test.ts +5 -5
  282. package/test/utils.test.ts +8 -9
package/svg.js CHANGED
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const argv = require('yargs')
4
- .usage('Usage: $0 [options]')
5
- .argv
3
+ const argv = require('yargs').usage('Usage: $0 [options]').argv;
6
4
 
7
5
  const svgstore = require('svgstore');
8
6
  const htmlclean = require('htmlclean');
@@ -14,14 +12,12 @@ const { digestSync } = require('fprint');
14
12
 
15
13
  const cwd = process.cwd();
16
14
 
17
- const PACK_DIR = cwd + "/static/svg/packs";
18
- const USED_DIR = cwd + "/static/svg/work/used";
19
- const TRACED_DIR = cwd + "/static/svg/work/traced";
15
+ const PACK_DIR = cwd + '/static/svg/packs';
16
+ const USED_DIR = cwd + '/static/svg/work/used';
17
+ const TRACED_DIR = cwd + '/static/svg/work/traced';
20
18
  const USAGE_REGEX = /'(.*)'/;
21
19
 
22
-
23
-
24
- const sprites = svgstore()
20
+ const sprites = svgstore();
25
21
 
26
22
  function processFileWithRegex(filePath, regexPattern) {
27
23
  try {
@@ -30,7 +26,7 @@ function processFileWithRegex(filePath, regexPattern) {
30
26
  const regex = new RegExp(regexPattern, 'g');
31
27
  let matches = [];
32
28
 
33
- lines.forEach(line => {
29
+ lines.forEach((line) => {
34
30
  let match;
35
31
  while ((match = regex.exec(line)) !== null) {
36
32
  matches.push(match[1]);
@@ -46,7 +42,7 @@ function processFileWithRegex(filePath, regexPattern) {
46
42
  // Convert matches array to an object with keys being the matches and values being true
47
43
  function matchesToObject(matches) {
48
44
  const result = {};
49
- matches.forEach(match => {
45
+ matches.forEach((match) => {
50
46
  result[match] = true;
51
47
  });
52
48
  return result;
@@ -55,7 +51,7 @@ function matchesToObject(matches) {
55
51
  function copyFilesInDict(sourceDir, targetDir, matchDict) {
56
52
  try {
57
53
  const files = fs.readdirSync(sourceDir);
58
- files.forEach(file => {
54
+ files.forEach((file) => {
59
55
  const fileNameWithoutExtension = path.parse(file).name;
60
56
  if (matchDict[fileNameWithoutExtension]) {
61
57
  const sourcePath = path.join(sourceDir, file);
@@ -94,18 +90,17 @@ function modifyFileContent(filePath, regexPattern, groupNumber, replacement) {
94
90
  }
95
91
 
96
92
  async function main() {
97
-
98
93
  // const OUTPUT_FILE_NAME = cwd + "/static/svg/index.svg";
99
94
  //const USAGE_FILE = './src/vectoricon/index.ts';
100
95
 
101
- const OUTPUT_FILE_NAME = argv.output || cwd + "/static/svg/index.svg";
96
+ const OUTPUT_FILE_NAME = argv.output || cwd + '/static/svg/index.svg';
102
97
  const USAGE_FILE = argv.usage || './src/vectoricon/index.ts';
103
98
 
104
99
  let packs = sh.ls(PACK_DIR);
105
100
  packs.sort();
106
101
 
107
102
  // create our work directory
108
- [USED_DIR, TRACED_DIR].forEach(dir => {
103
+ [USED_DIR, TRACED_DIR].forEach((dir) => {
109
104
  if (!fs.existsSync(dir)) {
110
105
  fs.mkdirSync(dir, { recursive: true });
111
106
  }
@@ -115,40 +110,44 @@ async function main() {
115
110
  const ids = matchesToObject(matches);
116
111
 
117
112
  // copy any icons from our packs that are used
118
- packs.forEach(pack => {
119
- copyFilesInDict(`${PACK_DIR}/${pack}`, USED_DIR, ids)
113
+ packs.forEach((pack) => {
114
+ copyFilesInDict(`${PACK_DIR}/${pack}`, USED_DIR, ids);
120
115
  });
121
116
 
122
117
  // trace our strokes so we can rely on consistent fills
123
118
  var options = {
124
119
  showProgressBar: true,
125
120
  throwIfDestinationDoesNotExist: false,
126
- traceResolution: argv.resolution || 600,
121
+ traceResolution: argv.resolution || 600
127
122
  };
128
123
 
129
124
  await SVGFixer(USED_DIR, TRACED_DIR, options).fix();
130
125
 
131
- const files = sh.find(TRACED_DIR)
132
- .filter(file => file.match(/\.svg$/));
126
+ const files = sh.find(TRACED_DIR).filter((file) => file.match(/\.svg$/));
133
127
 
134
- files.forEach(file => {
135
- const id = path.basename(file, '.svg')
136
- const contents = fs.readFileSync(file, 'utf8')
128
+ files.forEach((file) => {
129
+ const id = path.basename(file, '.svg');
130
+ const contents = fs.readFileSync(file, 'utf8');
137
131
  sprites.add(id, contents);
138
132
  });
139
133
 
140
- let output = htmlclean(sprites.toString({ cleanDefs: true, cleanSymbols: true, renameDefs: true }))
134
+ let output = htmlclean(
135
+ sprites.toString({ cleanDefs: true, cleanSymbols: true, renameDefs: true })
136
+ );
141
137
  output = output.replaceAll(/fill="black"/g, `fill="currentColor"`);
142
138
 
143
- fs.writeFileSync(OUTPUT_FILE_NAME, output)
139
+ fs.writeFileSync(OUTPUT_FILE_NAME, output);
144
140
  console.info('Merged %s files into %s', files.length, OUTPUT_FILE_NAME);
145
141
 
146
142
  const stream = fs.createReadStream(OUTPUT_FILE_NAME);
147
143
  const file = fs.readFileSync(OUTPUT_FILE_NAME);
148
144
  const md5 = digestSync(file, 'md5');
149
- modifyFileContent(USAGE_FILE, "export const SVG_FINGERPRINT = '(.*)';", 1, md5);
150
-
145
+ modifyFileContent(
146
+ USAGE_FILE,
147
+ "export const SVG_FINGERPRINT = '(.*)';",
148
+ 1,
149
+ md5
150
+ );
151
151
  }
152
152
 
153
-
154
- main();
153
+ main();
@@ -7,7 +7,7 @@ export const createAlert = async (level: string, body: string) => {
7
7
  const parentNode = document.createElement('div');
8
8
  parentNode.setAttribute('style', 'width: 250px;');
9
9
  return (await fixture(`<temba-alert level="${level}">${body}</temba-alert>`, {
10
- parentNode,
10
+ parentNode
11
11
  })) as Alert;
12
12
  };
13
13
 
@@ -27,7 +27,7 @@ describe('temba-checkbox', () => {
27
27
 
28
28
  it('fires change event on click', async () => {
29
29
  // eslint-disable-next-line no-async-promise-executor
30
- return new Promise<void>(async resolve => {
30
+ return new Promise<void>(async (resolve) => {
31
31
  const checkbox: Checkbox = await fixture(html`
32
32
  <temba-checkbox label="My Checkbox"></temba-checkbox>
33
33
  `);
@@ -12,7 +12,7 @@ describe('temba-color-picker', () => {
12
12
  it('renders default', async () => {
13
13
  const picker: ColorPicker = await getPicker({
14
14
  name: 'primary',
15
- label: 'Primary Color',
15
+ label: 'Primary Color'
16
16
  });
17
17
  assert.instanceOf(picker, ColorPicker);
18
18
  await assertScreenshot('colorpicker/default', getClip(picker));
@@ -22,7 +22,7 @@ describe('temba-color-picker', () => {
22
22
  const picker: ColorPicker = await getPicker({
23
23
  name: 'primary',
24
24
  label: 'Primary Color',
25
- value: '#2387ca',
25
+ value: '#2387ca'
26
26
  });
27
27
  await assertScreenshot('colorpicker/initialized', getClip(picker));
28
28
  });
@@ -31,7 +31,7 @@ describe('temba-color-picker', () => {
31
31
  const picker: ColorPicker = await getPicker({
32
32
  name: 'primary',
33
33
  label: 'Primary Color',
34
- value: '#2387ca',
34
+ value: '#2387ca'
35
35
  });
36
36
  (picker.shadowRoot.querySelector('.preview') as HTMLElement).click();
37
37
 
@@ -42,7 +42,7 @@ describe('temba-color-picker', () => {
42
42
  const picker: ColorPicker = await getPicker({
43
43
  name: 'primary',
44
44
  label: 'Primary Color',
45
- value: '#2387ca',
45
+ value: '#2387ca'
46
46
  });
47
47
  (picker.shadowRoot.querySelector('.preview') as HTMLElement).click();
48
48
 
@@ -41,17 +41,14 @@ const getInitialValue = (
41
41
  text: text ? text : '',
42
42
  attachments: attachments ? attachments : [],
43
43
  quick_replies: quick_replies ? quick_replies : [],
44
- optin: null,
45
- },
44
+ optin: null
45
+ }
46
46
  };
47
47
  return composeValue;
48
48
  };
49
49
  const getComposeValue = (value: any): string => {
50
50
  return JSON.stringify(value);
51
51
  };
52
- const getComposeValues = (value: any): any[] => {
53
- return [value];
54
- };
55
52
 
56
53
  export const getValidText = () => {
57
54
  return 'sà-wàd-dee!';
@@ -74,7 +71,7 @@ export const getValidAttachments = (numFiles = 2): Attachment[] => {
74
71
  filename: 'name_' + s,
75
72
  url: 'url_' + s,
76
73
  size: 1024,
77
- error: null,
74
+ error: null
78
75
  } as Attachment;
79
76
  attachments.push(attachment);
80
77
  index++;
@@ -91,7 +88,7 @@ export const getInvalidAttachments = (): Attachment[] => {
91
88
  filename: 'name_' + f1,
92
89
  url: 'url_' + f1,
93
90
  size: 26624,
94
- error: 'Limit for file uploads is 25.0 MB',
91
+ error: 'Limit for file uploads is 25.0 MB'
95
92
  } as Attachment;
96
93
  const f2 = 'f2';
97
94
  const fail2 = {
@@ -101,7 +98,7 @@ export const getInvalidAttachments = (): Attachment[] => {
101
98
  filename: 'name_' + f2,
102
99
  url: 'url_' + f2,
103
100
  size: 1024,
104
- error: 'Unsupported file type',
101
+ error: 'Unsupported file type'
105
102
  } as Attachment;
106
103
 
107
104
  return [fail1, fail2];
@@ -128,7 +125,7 @@ describe('temba-compose chatbox', () => {
128
125
 
129
126
  it('cannot be created with a different endpoint', async () => {
130
127
  const compose: Compose = await getCompose({
131
- endpoint: '/schmsgmedia/schmupload/',
128
+ endpoint: '/schmsgmedia/schmupload/'
132
129
  });
133
130
  assert.instanceOf(compose, Compose);
134
131
  expect(compose.endpoint).equals(DEFAULT_MEDIA_ENDPOINT);
@@ -136,7 +133,7 @@ describe('temba-compose chatbox', () => {
136
133
 
137
134
  it('chatbox no counter no send button', async () => {
138
135
  const compose: Compose = await getCompose({
139
- chatbox: true,
136
+ chatbox: true
140
137
  });
141
138
  await assertScreenshot(
142
139
  'compose/chatbox-no-counter-no-send-button',
@@ -147,7 +144,7 @@ describe('temba-compose chatbox', () => {
147
144
  it('chatbox no counter and send button', async () => {
148
145
  const compose: Compose = await getCompose({
149
146
  chatbox: true,
150
- button: true,
147
+ button: true
151
148
  });
152
149
  await assertScreenshot(
153
150
  'compose/chatbox-no-counter-and-send-button',
@@ -158,7 +155,7 @@ describe('temba-compose chatbox', () => {
158
155
  it('chatbox counter no send button', async () => {
159
156
  const compose: Compose = await getCompose({
160
157
  chatbox: true,
161
- counter: true,
158
+ counter: true
162
159
  });
163
160
  await assertScreenshot(
164
161
  'compose/chatbox-counter-no-send-button',
@@ -170,7 +167,7 @@ describe('temba-compose chatbox', () => {
170
167
  const compose: Compose = await getCompose({
171
168
  chatbox: true,
172
169
  counter: true,
173
- button: true,
170
+ button: true
174
171
  });
175
172
  await assertScreenshot(
176
173
  'compose/chatbox-counter-and-send-button',
@@ -186,7 +183,7 @@ describe('temba-compose chatbox', () => {
186
183
  chatbox: true,
187
184
  counter: true,
188
185
  button: true,
189
- value: composeValue,
186
+ value: composeValue
190
187
  });
191
188
  // deserialize
192
189
  expect(compose.currentText).to.equal('');
@@ -199,7 +196,7 @@ describe('temba-compose chatbox', () => {
199
196
  const compose: Compose = await getCompose({
200
197
  chatbox: true,
201
198
  counter: true,
202
- button: true,
199
+ button: true
203
200
  });
204
201
  await updateComponent(compose, getValidText());
205
202
  await assertScreenshot('compose/chatbox-with-text', getClip(compose));
@@ -213,7 +210,7 @@ describe('temba-compose chatbox', () => {
213
210
  chatbox: true,
214
211
  counter: true,
215
212
  button: true,
216
- value: composeValue,
213
+ value: composeValue
217
214
  });
218
215
  // deserialize
219
216
  expect(compose.currentText).to.equal(getValidText());
@@ -226,7 +223,7 @@ describe('temba-compose chatbox', () => {
226
223
  const compose: Compose = await getCompose({
227
224
  chatbox: true,
228
225
  counter: true,
229
- button: true,
226
+ button: true
230
227
  });
231
228
  await updateComponent(compose, getValidText_Long_WithSpaces());
232
229
  await assertScreenshot(
@@ -239,7 +236,7 @@ describe('temba-compose chatbox', () => {
239
236
  const compose: Compose = await getCompose({
240
237
  chatbox: true,
241
238
  counter: true,
242
- button: true,
239
+ button: true
243
240
  });
244
241
  await updateComponent(compose, getValidText_Long_WithNoSpaces());
245
242
  await assertScreenshot(
@@ -252,7 +249,7 @@ describe('temba-compose chatbox', () => {
252
249
  const compose: Compose = await getCompose({
253
250
  chatbox: true,
254
251
  counter: true,
255
- button: true,
252
+ button: true
256
253
  });
257
254
  await updateComponent(compose, getValidText_Long_WithUrl());
258
255
  await assertScreenshot(
@@ -265,7 +262,7 @@ describe('temba-compose chatbox', () => {
265
262
  const compose: Compose = await getCompose({
266
263
  chatbox: true,
267
264
  counter: true,
268
- button: true,
265
+ button: true
269
266
  });
270
267
  await updateComponent(compose, getValidText());
271
268
  const send = compose.shadowRoot.querySelector(
@@ -282,7 +279,7 @@ describe('temba-compose chatbox', () => {
282
279
  const compose: Compose = await getCompose({
283
280
  chatbox: true,
284
281
  counter: true,
285
- button: true,
282
+ button: true
286
283
  });
287
284
  await updateComponent(compose, getValidText());
288
285
  const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
@@ -297,7 +294,7 @@ describe('temba-compose chatbox', () => {
297
294
  describe('temba-compose attachments', () => {
298
295
  it('attachments no send button', async () => {
299
296
  const compose: Compose = await getCompose({
300
- attachments: true,
297
+ attachments: true
301
298
  });
302
299
  await assertScreenshot(
303
300
  'compose/attachments-no-send-button',
@@ -308,7 +305,7 @@ describe('temba-compose attachments', () => {
308
305
  it('attachments and send button', async () => {
309
306
  const compose: Compose = await getCompose({
310
307
  attachments: true,
311
- button: true,
308
+ button: true
312
309
  });
313
310
  await assertScreenshot(
314
311
  'compose/attachments-and-send-button',
@@ -323,7 +320,7 @@ describe('temba-compose attachments', () => {
323
320
  const compose: Compose = await getCompose({
324
321
  attachments: true,
325
322
  button: true,
326
- value: composeValue,
323
+ value: composeValue
327
324
  });
328
325
  // deserialize
329
326
  expect(compose.currentText).to.equal('');
@@ -335,7 +332,7 @@ describe('temba-compose attachments', () => {
335
332
  it('attachments with success uploaded files', async () => {
336
333
  const compose: Compose = await getCompose({
337
334
  attachments: true,
338
- button: true,
335
+ button: true
339
336
  });
340
337
  await updateComponent(compose, null, getValidAttachments());
341
338
  await assertScreenshot(
@@ -347,12 +344,10 @@ describe('temba-compose attachments', () => {
347
344
  it('attachments with success uploaded files deserialize and serialize', async () => {
348
345
  const initialValue = getInitialValue(null, getValidAttachments());
349
346
  const composeValue = getComposeValue(initialValue);
350
- const composeValues = getComposeValues(initialValue);
351
-
352
347
  const compose: Compose = await getCompose({
353
348
  attachments: true,
354
349
  button: true,
355
- value: composeValue,
350
+ value: composeValue
356
351
  });
357
352
  // deserialize
358
353
  expect(compose.currentText).to.equal('');
@@ -364,7 +359,7 @@ describe('temba-compose attachments', () => {
364
359
  it('attachments with failure uploaded files', async () => {
365
360
  const compose: Compose = await getCompose({
366
361
  attachments: true,
367
- button: true,
362
+ button: true
368
363
  });
369
364
  await updateComponent(compose, null, null, getInvalidAttachments());
370
365
  await assertScreenshot(
@@ -376,7 +371,7 @@ describe('temba-compose attachments', () => {
376
371
  it('attachments with success and failure uploaded files', async () => {
377
372
  const compose: Compose = await getCompose({
378
373
  attachments: true,
379
- button: true,
374
+ button: true
380
375
  });
381
376
  await updateComponent(
382
377
  compose,
@@ -393,7 +388,7 @@ describe('temba-compose attachments', () => {
393
388
  it('attachments with success uploaded files and click send', async () => {
394
389
  const compose: Compose = await getCompose({
395
390
  attachments: true,
396
- button: true,
391
+ button: true
397
392
  });
398
393
  await updateComponent(compose, null, getValidAttachments());
399
394
  const send = compose.shadowRoot.querySelector(
@@ -409,7 +404,7 @@ describe('temba-compose attachments', () => {
409
404
  it('attachments with success and failure uploaded files and click send', async () => {
410
405
  const compose: Compose = await getCompose({
411
406
  attachments: true,
412
- button: true,
407
+ button: true
413
408
  });
414
409
  await updateComponent(
415
410
  compose,
@@ -432,7 +427,7 @@ describe('temba-compose chatbox and attachments', () => {
432
427
  it('chatbox and attachments no counter no send button', async () => {
433
428
  const compose: Compose = await getCompose({
434
429
  chatbox: true,
435
- attachments: true,
430
+ attachments: true
436
431
  });
437
432
  await assertScreenshot(
438
433
  'compose/chatbox-attachments-no-counter-no-send-button',
@@ -444,7 +439,7 @@ describe('temba-compose chatbox and attachments', () => {
444
439
  const compose: Compose = await getCompose({
445
440
  chatbox: true,
446
441
  attachments: true,
447
- button: true,
442
+ button: true
448
443
  });
449
444
  await assertScreenshot(
450
445
  'compose/chatbox-attachments-no-counter-and-send-button',
@@ -456,7 +451,7 @@ describe('temba-compose chatbox and attachments', () => {
456
451
  const compose: Compose = await getCompose({
457
452
  chatbox: true,
458
453
  attachments: true,
459
- counter: true,
454
+ counter: true
460
455
  });
461
456
  await assertScreenshot(
462
457
  'compose/chatbox-attachments-counter-no-send-button',
@@ -469,7 +464,7 @@ describe('temba-compose chatbox and attachments', () => {
469
464
  chatbox: true,
470
465
  attachments: true,
471
466
  counter: true,
472
- button: true,
467
+ button: true
473
468
  });
474
469
  await assertScreenshot(
475
470
  'compose/chatbox-attachments-counter-and-send-button',
@@ -486,7 +481,7 @@ describe('temba-compose chatbox and attachments', () => {
486
481
  attachments: true,
487
482
  counter: true,
488
483
  button: true,
489
- value: composeValue,
484
+ value: composeValue
490
485
  });
491
486
  // deserialize
492
487
  expect(compose.currentText).to.equal('');
@@ -502,7 +497,7 @@ describe('temba-compose chatbox with text and attachments no files', () => {
502
497
  chatbox: true,
503
498
  attachments: true,
504
499
  counter: true,
505
- button: true,
500
+ button: true
506
501
  });
507
502
  updateComponent(compose, getValidText());
508
503
  await assertScreenshot(
@@ -520,7 +515,7 @@ describe('temba-compose chatbox with text and attachments no files', () => {
520
515
  attachments: true,
521
516
  counter: true,
522
517
  button: true,
523
- value: composeValue,
518
+ value: composeValue
524
519
  });
525
520
  // deserialize
526
521
  expect(compose.currentText).to.equal(getValidText());
@@ -534,7 +529,7 @@ describe('temba-compose chatbox with text and attachments no files', () => {
534
529
  chatbox: true,
535
530
  attachments: true,
536
531
  counter: true,
537
- button: true,
532
+ button: true
538
533
  });
539
534
  updateComponent(compose, getValidText());
540
535
  const send = compose.shadowRoot.querySelector(
@@ -552,7 +547,7 @@ describe('temba-compose chatbox with text and attachments no files', () => {
552
547
  chatbox: true,
553
548
  attachments: true,
554
549
  counter: true,
555
- button: true,
550
+ button: true
556
551
  });
557
552
  await updateComponent(compose, getValidText());
558
553
  const chatbox = compose.shadowRoot.querySelector('.chatbox') as HTMLElement;
@@ -569,7 +564,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
569
564
  const compose: Compose = await getCompose({
570
565
  chatbox: true,
571
566
  attachments: true,
572
- button: true,
567
+ button: true
573
568
  });
574
569
  await updateComponent(compose, null, getValidAttachments());
575
570
  await assertScreenshot(
@@ -586,7 +581,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
586
581
  chatbox: true,
587
582
  attachments: true,
588
583
  button: true,
589
- value: composeValue,
584
+ value: composeValue
590
585
  });
591
586
  // deserialize
592
587
  expect(compose.currentText).to.equal('');
@@ -599,7 +594,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
599
594
  const compose: Compose = await getCompose({
600
595
  chatbox: true,
601
596
  attachments: true,
602
- button: true,
597
+ button: true
603
598
  });
604
599
  await updateComponent(compose, null, null, getInvalidAttachments());
605
600
  await assertScreenshot(
@@ -612,7 +607,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
612
607
  const compose: Compose = await getCompose({
613
608
  chatbox: true,
614
609
  attachments: true,
615
- button: true,
610
+ button: true
616
611
  });
617
612
  await updateComponent(
618
613
  compose,
@@ -630,7 +625,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
630
625
  const compose: Compose = await getCompose({
631
626
  chatbox: true,
632
627
  attachments: true,
633
- button: true,
628
+ button: true
634
629
  });
635
630
  await updateComponent(compose, null, getValidAttachments());
636
631
  const send = compose.shadowRoot.querySelector(
@@ -647,7 +642,7 @@ describe('temba-compose chatbox no text and attachments with files', () => {
647
642
  const compose: Compose = await getCompose({
648
643
  chatbox: true,
649
644
  attachments: true,
650
- button: true,
645
+ button: true
651
646
  });
652
647
  await updateComponent(
653
648
  compose,
@@ -671,7 +666,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
671
666
  const compose: Compose = await getCompose({
672
667
  chatbox: true,
673
668
  attachments: true,
674
- button: true,
669
+ button: true
675
670
  });
676
671
  await updateComponent(compose, getValidText(), getValidAttachments());
677
672
  await assertScreenshot(
@@ -688,7 +683,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
688
683
  chatbox: true,
689
684
  attachments: true,
690
685
  button: true,
691
- value: composeValue,
686
+ value: composeValue
692
687
  });
693
688
  // deserialize
694
689
  expect(compose.currentText).to.equal(getValidText());
@@ -701,7 +696,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
701
696
  const compose: Compose = await getCompose({
702
697
  chatbox: true,
703
698
  attachments: true,
704
- button: true,
699
+ button: true
705
700
  });
706
701
  await updateComponent(
707
702
  compose,
@@ -719,7 +714,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
719
714
  const compose: Compose = await getCompose({
720
715
  chatbox: true,
721
716
  attachments: true,
722
- button: true,
717
+ button: true
723
718
  });
724
719
  await updateComponent(
725
720
  compose,
@@ -737,7 +732,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
737
732
  const compose: Compose = await getCompose({
738
733
  chatbox: true,
739
734
  attachments: true,
740
- button: true,
735
+ button: true
741
736
  });
742
737
  await updateComponent(compose, getValidText(), getValidAttachments());
743
738
  const send = compose.shadowRoot.querySelector(
@@ -754,7 +749,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
754
749
  const compose: Compose = await getCompose({
755
750
  chatbox: true,
756
751
  attachments: true,
757
- button: true,
752
+ button: true
758
753
  });
759
754
  await updateComponent(
760
755
  compose,
@@ -776,7 +771,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
776
771
  const compose: Compose = await getCompose({
777
772
  chatbox: true,
778
773
  attachments: true,
779
- button: true,
774
+ button: true
780
775
  });
781
776
  await updateComponent(compose, getValidText(), getValidAttachments());
782
777
  const chatbox = compose.shadowRoot.querySelector('.chatbox') as HTMLElement;
@@ -791,7 +786,7 @@ describe('temba-compose chatbox with text and attachments with files', () => {
791
786
  const compose: Compose = await getCompose({
792
787
  chatbox: true,
793
788
  attachments: true,
794
- button: true,
789
+ button: true
795
790
  });
796
791
  await updateComponent(
797
792
  compose,
@@ -5,7 +5,7 @@ import {
5
5
  delay,
6
6
  getClip,
7
7
  getComponent,
8
- loadStore,
8
+ loadStore
9
9
  } from './utils.test';
10
10
 
11
11
  const TAG = 'temba-contact-badges';
@@ -25,7 +25,7 @@ describe('temba-contact-badges', () => {
25
25
  await loadStore();
26
26
 
27
27
  const badges: ContactBadges = await getBadges({
28
- contact: 'contact-dave-active',
28
+ contact: 'contact-dave-active'
29
29
  });
30
30
  assert.instanceOf(badges, ContactBadges);
31
31
  await assertScreenshot('contacts/badges', getClip(badges));