@dialpad/dialtone-vue 3.120.0 → 3.120.2

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 (425) hide show
  1. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js +11 -0
  2. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js.map +1 -0
  3. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js +10 -0
  4. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js.map +1 -0
  5. package/dist/chunks/{dropdown-eWOvBvwq.js → dropdown-Hn-TeTvZ.js} +151 -104
  6. package/dist/chunks/{dropdown-UO3UJalk.js.map → dropdown-Hn-TeTvZ.js.map} +1 -1
  7. package/dist/chunks/dropdown-w8Do29L5.js +442 -0
  8. package/dist/chunks/{dropdown-eWOvBvwq.js.map → dropdown-w8Do29L5.js.map} +1 -1
  9. package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
  10. package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
  11. package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
  12. package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
  13. package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
  14. package/dist/chunks/{icon_constants-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
  15. package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
  16. package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
  17. package/dist/chunks/index-4qgKeErp.js +446 -0
  18. package/dist/chunks/{index-b4iXYvId.js.map → index-4qgKeErp.js.map} +1 -1
  19. package/dist/chunks/index-b_MgDylR.js +447 -0
  20. package/dist/chunks/{index-6tYeqbgP.js.map → index-b_MgDylR.js.map} +1 -1
  21. package/dist/chunks/{input-4UQWegUk.js → input-NmYDD5bn.js} +83 -60
  22. package/dist/chunks/{input-0Uksk4DP.js.map → input-NmYDD5bn.js.map} +1 -1
  23. package/dist/chunks/input-ttnte8zB.js +295 -0
  24. package/dist/chunks/{input-4UQWegUk.js.map → input-ttnte8zB.js.map} +1 -1
  25. package/dist/chunks/input_group-M-D25pOJ.js +152 -0
  26. package/dist/chunks/{input_group-bBKaq3Wi.js.map → input_group-M-D25pOJ.js.map} +1 -1
  27. package/dist/chunks/{input_group-bBKaq3Wi.js → input_group-jWnq2DJT.js} +27 -24
  28. package/dist/chunks/{input_group-AS760Cp7.js.map → input_group-jWnq2DJT.js.map} +1 -1
  29. package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
  30. package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
  31. package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
  32. package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
  33. package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
  34. package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
  35. package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
  36. package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
  37. package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
  38. package/dist/chunks/{list_item_constants-Tsz5CO1m.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
  39. package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
  40. package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
  41. package/dist/chunks/modal-VgxXAQFP.js +105 -0
  42. package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
  43. package/dist/chunks/modal-XOr4kiNZ.js +106 -0
  44. package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
  45. package/dist/chunks/notice_action-WTucGhvr.js +222 -0
  46. package/dist/chunks/{notice_action-tJfD5Qw1.js.map → notice_action-WTucGhvr.js.map} +1 -1
  47. package/dist/chunks/notice_action-p-ePanW_.js +223 -0
  48. package/dist/chunks/{notice_action-jO199emq.js.map → notice_action-p-ePanW_.js.map} +1 -1
  49. package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
  50. package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
  51. package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
  52. package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
  53. package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
  54. package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
  55. package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
  56. package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
  57. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js → sr_only_close_button-3EdsV-dH.js} +28 -24
  58. package/dist/chunks/{sr_only_close_button-iD7s1Pbj.js.map → sr_only_close_button-3EdsV-dH.js.map} +1 -1
  59. package/dist/chunks/sr_only_close_button-xGrHFjwA.js +91 -0
  60. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js.map → sr_only_close_button-xGrHFjwA.js.map} +1 -1
  61. package/dist/chunks/stack_constants-HraCekPm.js +15 -0
  62. package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
  63. package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
  64. package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
  65. package/dist/chunks/tab-RTDgnD9-.js +391 -0
  66. package/dist/chunks/{tab-at7WWglk.js.map → tab-RTDgnD9-.js.map} +1 -1
  67. package/dist/chunks/tab-qc3f42Yp.js +390 -0
  68. package/dist/chunks/{tab-GQZFMq83.js.map → tab-qc3f42Yp.js.map} +1 -1
  69. package/dist/common/constants.cjs +60 -0
  70. package/dist/{lib → common}/constants.cjs.map +1 -1
  71. package/dist/{lib → common}/constants.js +25 -18
  72. package/dist/{lib → common}/constants.js.map +1 -1
  73. package/dist/common/dates.cjs +72 -0
  74. package/dist/{lib → common}/dates.cjs.map +1 -1
  75. package/dist/common/dates.js +72 -0
  76. package/dist/{lib → common}/dates.js.map +1 -1
  77. package/dist/common/emoji.cjs +163 -0
  78. package/dist/common/emoji.cjs.map +1 -0
  79. package/dist/common/emoji.js +168 -0
  80. package/dist/common/emoji.js.map +1 -0
  81. package/dist/common/mixins.cjs +17 -0
  82. package/dist/{lib → common}/mixins.cjs.map +1 -1
  83. package/dist/common/mixins.js +17 -0
  84. package/dist/common/utils.cjs +243 -0
  85. package/dist/{lib → common}/utils.cjs.map +1 -1
  86. package/dist/common/utils.js +243 -0
  87. package/dist/{lib → common}/utils.js.map +1 -1
  88. package/dist/common/validators.cjs +23 -0
  89. package/dist/{lib → common}/validators.cjs.map +1 -1
  90. package/dist/common/validators.js +23 -0
  91. package/dist/{lib → common}/validators.js.map +1 -1
  92. package/dist/dialtone-vue.cjs +373 -1
  93. package/dist/dialtone-vue.cjs.map +1 -1
  94. package/dist/dialtone-vue.js +328 -327
  95. package/dist/dialtone-vue.js.map +1 -1
  96. package/dist/lib/attachment-carousel.cjs +345 -1
  97. package/dist/lib/attachment-carousel.cjs.map +1 -1
  98. package/dist/lib/attachment-carousel.js +126 -108
  99. package/dist/lib/attachment-carousel.js.map +1 -1
  100. package/dist/lib/avatar.cjs +447 -1
  101. package/dist/lib/avatar.cjs.map +1 -1
  102. package/dist/lib/avatar.js +135 -101
  103. package/dist/lib/avatar.js.map +1 -1
  104. package/dist/lib/badge.cjs +206 -1
  105. package/dist/lib/badge.cjs.map +1 -1
  106. package/dist/lib/badge.js +64 -48
  107. package/dist/lib/badge.js.map +1 -1
  108. package/dist/lib/banner.cjs +242 -2
  109. package/dist/lib/banner.cjs.map +1 -1
  110. package/dist/lib/banner.js +81 -71
  111. package/dist/lib/banner.js.map +1 -1
  112. package/dist/lib/breadcrumbs.cjs +150 -1
  113. package/dist/lib/breadcrumbs.cjs.map +1 -1
  114. package/dist/lib/breadcrumbs.js +60 -52
  115. package/dist/lib/breadcrumbs.js.map +1 -1
  116. package/dist/lib/button-group.cjs +41 -1
  117. package/dist/lib/button-group.cjs.map +1 -1
  118. package/dist/lib/button-group.js +15 -14
  119. package/dist/lib/button-group.js.map +1 -1
  120. package/dist/lib/button.cjs +356 -1
  121. package/dist/lib/button.cjs.map +1 -1
  122. package/dist/lib/button.js +108 -88
  123. package/dist/lib/button.js.map +1 -1
  124. package/dist/lib/callbar-button-with-popover.cjs +322 -1
  125. package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
  126. package/dist/lib/callbar-button-with-popover.js +101 -83
  127. package/dist/lib/callbar-button-with-popover.js.map +1 -1
  128. package/dist/lib/callbar-button.cjs +200 -1
  129. package/dist/lib/callbar-button.cjs.map +1 -1
  130. package/dist/lib/callbar-button.js +52 -45
  131. package/dist/lib/callbar-button.js.map +1 -1
  132. package/dist/lib/callbox.cjs +217 -1
  133. package/dist/lib/callbox.cjs.map +1 -1
  134. package/dist/lib/callbox.js +80 -67
  135. package/dist/lib/callbox.js.map +1 -1
  136. package/dist/lib/card.cjs +91 -1
  137. package/dist/lib/card.cjs.map +1 -1
  138. package/dist/lib/card.js +27 -27
  139. package/dist/lib/card.js.map +1 -1
  140. package/dist/lib/checkbox-group.cjs +115 -1
  141. package/dist/lib/checkbox-group.cjs.map +1 -1
  142. package/dist/lib/checkbox-group.js +34 -23
  143. package/dist/lib/checkbox-group.js.map +1 -1
  144. package/dist/lib/checkbox.cjs +156 -1
  145. package/dist/lib/checkbox.cjs.map +1 -1
  146. package/dist/lib/checkbox.js +72 -60
  147. package/dist/lib/checkbox.js.map +1 -1
  148. package/dist/lib/chip.cjs +235 -1
  149. package/dist/lib/chip.cjs.map +1 -1
  150. package/dist/lib/chip.js +84 -67
  151. package/dist/lib/chip.js.map +1 -1
  152. package/dist/lib/codeblock.cjs +23 -2
  153. package/dist/lib/codeblock.cjs.map +1 -1
  154. package/dist/lib/codeblock.js +13 -13
  155. package/dist/lib/codeblock.js.map +1 -1
  156. package/dist/lib/collapsible.cjs +398 -1
  157. package/dist/lib/collapsible.cjs.map +1 -1
  158. package/dist/lib/collapsible.js +123 -100
  159. package/dist/lib/collapsible.js.map +1 -1
  160. package/dist/lib/combobox-multi-select.cjs +589 -1
  161. package/dist/lib/combobox-multi-select.cjs.map +1 -1
  162. package/dist/lib/combobox-multi-select.js +270 -177
  163. package/dist/lib/combobox-multi-select.js.map +1 -1
  164. package/dist/lib/combobox-with-popover.cjs +452 -1
  165. package/dist/lib/combobox-with-popover.cjs.map +1 -1
  166. package/dist/lib/combobox-with-popover.js +172 -127
  167. package/dist/lib/combobox-with-popover.js.map +1 -1
  168. package/dist/lib/combobox.cjs +18 -1
  169. package/dist/lib/combobox.cjs.map +1 -1
  170. package/dist/lib/combobox.js +9 -9
  171. package/dist/lib/contact-info.cjs +205 -1
  172. package/dist/lib/contact-info.cjs.map +1 -1
  173. package/dist/lib/contact-info.js +69 -60
  174. package/dist/lib/contact-info.js.map +1 -1
  175. package/dist/lib/contact-row.cjs +246 -1
  176. package/dist/lib/contact-row.cjs.map +1 -1
  177. package/dist/lib/contact-row.js +67 -63
  178. package/dist/lib/contact-row.js.map +1 -1
  179. package/dist/lib/datepicker.cjs +854 -1
  180. package/dist/lib/datepicker.cjs.map +1 -1
  181. package/dist/lib/datepicker.js +585 -441
  182. package/dist/lib/datepicker.js.map +1 -1
  183. package/dist/lib/description-list.cjs +116 -1
  184. package/dist/lib/description-list.cjs.map +1 -1
  185. package/dist/lib/description-list.js +56 -24
  186. package/dist/lib/description-list.js.map +1 -1
  187. package/dist/lib/dropdown.cjs +36 -1
  188. package/dist/lib/dropdown.cjs.map +1 -1
  189. package/dist/lib/dropdown.js +22 -21
  190. package/dist/lib/dropdown.js.map +1 -1
  191. package/dist/lib/editor.cjs +711 -1
  192. package/dist/lib/editor.cjs.map +1 -1
  193. package/dist/lib/editor.js +271 -235
  194. package/dist/lib/editor.js.map +1 -1
  195. package/dist/lib/emoji-picker.cjs +1277 -1
  196. package/dist/lib/emoji-picker.cjs.map +1 -1
  197. package/dist/lib/emoji-picker.js +859 -569
  198. package/dist/lib/emoji-picker.js.map +1 -1
  199. package/dist/lib/emoji-row.cjs +128 -1
  200. package/dist/lib/emoji-row.cjs.map +1 -1
  201. package/dist/lib/emoji-row.js +89 -75
  202. package/dist/lib/emoji-row.js.map +1 -1
  203. package/dist/lib/emoji-text-wrapper.cjs +102 -1
  204. package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
  205. package/dist/lib/emoji-text-wrapper.js +42 -31
  206. package/dist/lib/emoji-text-wrapper.js.map +1 -1
  207. package/dist/lib/emoji.cjs +158 -1
  208. package/dist/lib/emoji.cjs.map +1 -1
  209. package/dist/lib/emoji.js +153 -6
  210. package/dist/lib/emoji.js.map +1 -1
  211. package/dist/lib/feed-item-row.cjs +296 -1
  212. package/dist/lib/feed-item-row.cjs.map +1 -1
  213. package/dist/lib/feed-item-row.js +119 -100
  214. package/dist/lib/feed-item-row.js.map +1 -1
  215. package/dist/lib/feed-pill.cjs +173 -1
  216. package/dist/lib/feed-pill.cjs.map +1 -1
  217. package/dist/lib/feed-pill.js +70 -57
  218. package/dist/lib/feed-pill.js.map +1 -1
  219. package/dist/lib/general-row.cjs +518 -1
  220. package/dist/lib/general-row.cjs.map +1 -1
  221. package/dist/lib/general-row.js +186 -148
  222. package/dist/lib/general-row.js.map +1 -1
  223. package/dist/lib/group-row.cjs +116 -1
  224. package/dist/lib/group-row.cjs.map +1 -1
  225. package/dist/lib/group-row.js +37 -35
  226. package/dist/lib/group-row.js.map +1 -1
  227. package/dist/lib/grouped-chip.cjs +96 -1
  228. package/dist/lib/grouped-chip.cjs.map +1 -1
  229. package/dist/lib/grouped-chip.js +51 -46
  230. package/dist/lib/grouped-chip.js.map +1 -1
  231. package/dist/lib/hovercard.cjs +223 -1
  232. package/dist/lib/hovercard.cjs.map +1 -1
  233. package/dist/lib/hovercard.js +115 -80
  234. package/dist/lib/hovercard.js.map +1 -1
  235. package/dist/lib/icon.cjs +58 -1
  236. package/dist/lib/icon.cjs.map +1 -1
  237. package/dist/lib/icon.js +20 -20
  238. package/dist/lib/icon.js.map +1 -1
  239. package/dist/lib/image-viewer.cjs +243 -1
  240. package/dist/lib/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer.js +104 -80
  242. package/dist/lib/image-viewer.js.map +1 -1
  243. package/dist/lib/input-group.cjs +91 -1
  244. package/dist/lib/input-group.cjs.map +1 -1
  245. package/dist/lib/input-group.js +41 -39
  246. package/dist/lib/input-group.js.map +1 -1
  247. package/dist/lib/input.cjs +578 -1
  248. package/dist/lib/input.cjs.map +1 -1
  249. package/dist/lib/input.js +185 -137
  250. package/dist/lib/input.js.map +1 -1
  251. package/dist/lib/item-layout.cjs +91 -1
  252. package/dist/lib/item-layout.cjs.map +1 -1
  253. package/dist/lib/item-layout.js +45 -39
  254. package/dist/lib/item-layout.js.map +1 -1
  255. package/dist/lib/ivr-node.cjs +263 -1
  256. package/dist/lib/ivr-node.cjs.map +1 -1
  257. package/dist/lib/ivr-node.js +130 -112
  258. package/dist/lib/ivr-node.js.map +1 -1
  259. package/dist/lib/keyboard-shortcut.cjs +119 -1
  260. package/dist/lib/keyboard-shortcut.cjs.map +1 -1
  261. package/dist/lib/keyboard-shortcut.js +58 -48
  262. package/dist/lib/keyboard-shortcut.js.map +1 -1
  263. package/dist/lib/lazy-show.cjs +82 -1
  264. package/dist/lib/lazy-show.cjs.map +1 -1
  265. package/dist/lib/lazy-show.js +21 -19
  266. package/dist/lib/lazy-show.js.map +1 -1
  267. package/dist/lib/link.cjs +43 -1
  268. package/dist/lib/link.cjs.map +1 -1
  269. package/dist/lib/link.js +20 -19
  270. package/dist/lib/link.js.map +1 -1
  271. package/dist/lib/list-item-group.cjs +67 -1
  272. package/dist/lib/list-item-group.cjs.map +1 -1
  273. package/dist/lib/list-item-group.js +24 -22
  274. package/dist/lib/list-item-group.js.map +1 -1
  275. package/dist/lib/list-item.cjs +216 -1
  276. package/dist/lib/list-item.cjs.map +1 -1
  277. package/dist/lib/list-item.js +71 -60
  278. package/dist/lib/list-item.js.map +1 -1
  279. package/dist/lib/message-input.cjs +708 -1
  280. package/dist/lib/message-input.cjs.map +1 -1
  281. package/dist/lib/message-input.js +232 -206
  282. package/dist/lib/message-input.js.map +1 -1
  283. package/dist/lib/modal.cjs +444 -2
  284. package/dist/lib/modal.cjs.map +1 -1
  285. package/dist/lib/modal.js +153 -120
  286. package/dist/lib/modal.js.map +1 -1
  287. package/dist/lib/notice.cjs +197 -1
  288. package/dist/lib/notice.cjs.map +1 -1
  289. package/dist/lib/notice.js +66 -63
  290. package/dist/lib/notice.js.map +1 -1
  291. package/dist/lib/pagination.cjs +205 -1
  292. package/dist/lib/pagination.cjs.map +1 -1
  293. package/dist/lib/pagination.js +96 -81
  294. package/dist/lib/pagination.js.map +1 -1
  295. package/dist/lib/popover.cjs +1080 -1
  296. package/dist/lib/popover.cjs.map +1 -1
  297. package/dist/lib/popover.js +447 -267
  298. package/dist/lib/popover.js.map +1 -1
  299. package/dist/lib/presence.cjs +70 -1
  300. package/dist/lib/presence.cjs.map +1 -1
  301. package/dist/lib/presence.js +33 -27
  302. package/dist/lib/presence.js.map +1 -1
  303. package/dist/lib/radio-group.cjs +88 -1
  304. package/dist/lib/radio-group.cjs.map +1 -1
  305. package/dist/lib/radio-group.js +18 -18
  306. package/dist/lib/radio-group.js.map +1 -1
  307. package/dist/lib/radio.cjs +162 -1
  308. package/dist/lib/radio.cjs.map +1 -1
  309. package/dist/lib/radio.js +66 -57
  310. package/dist/lib/radio.js.map +1 -1
  311. package/dist/lib/rich-text-editor.cjs +1137 -1
  312. package/dist/lib/rich-text-editor.cjs.map +1 -1
  313. package/dist/lib/rich-text-editor.js +567 -386
  314. package/dist/lib/rich-text-editor.js.map +1 -1
  315. package/dist/lib/root-layout.cjs +158 -1
  316. package/dist/lib/root-layout.cjs.map +1 -1
  317. package/dist/lib/root-layout.js +33 -31
  318. package/dist/lib/root-layout.js.map +1 -1
  319. package/dist/lib/scroller.cjs +1090 -1
  320. package/dist/lib/scroller.cjs.map +1 -1
  321. package/dist/lib/scroller.js +668 -345
  322. package/dist/lib/scroller.js.map +1 -1
  323. package/dist/lib/select-menu.cjs +312 -1
  324. package/dist/lib/select-menu.cjs.map +1 -1
  325. package/dist/lib/select-menu.js +124 -79
  326. package/dist/lib/select-menu.js.map +1 -1
  327. package/dist/lib/settings-menu-button.cjs +77 -1
  328. package/dist/lib/settings-menu-button.cjs.map +1 -1
  329. package/dist/lib/settings-menu-button.js +31 -30
  330. package/dist/lib/settings-menu-button.js.map +1 -1
  331. package/dist/lib/skeleton.cjs +635 -1
  332. package/dist/lib/skeleton.cjs.map +1 -1
  333. package/dist/lib/skeleton.js +189 -152
  334. package/dist/lib/skeleton.js.map +1 -1
  335. package/dist/lib/stack.cjs +123 -1
  336. package/dist/lib/stack.cjs.map +1 -1
  337. package/dist/lib/stack.js +61 -53
  338. package/dist/lib/stack.js.map +1 -1
  339. package/dist/lib/tabs.cjs +102 -1
  340. package/dist/lib/tabs.cjs.map +1 -1
  341. package/dist/lib/tabs.js +47 -41
  342. package/dist/lib/tabs.js.map +1 -1
  343. package/dist/lib/time-pill.cjs +41 -1
  344. package/dist/lib/time-pill.cjs.map +1 -1
  345. package/dist/lib/time-pill.js +18 -14
  346. package/dist/lib/time-pill.js.map +1 -1
  347. package/dist/lib/toast.cjs +281 -1
  348. package/dist/lib/toast.cjs.map +1 -1
  349. package/dist/lib/toast.js +96 -74
  350. package/dist/lib/toast.js.map +1 -1
  351. package/dist/lib/toggle.cjs +192 -1
  352. package/dist/lib/toggle.cjs.map +1 -1
  353. package/dist/lib/toggle.js +60 -49
  354. package/dist/lib/toggle.js.map +1 -1
  355. package/dist/lib/tooltip-directive.cjs +84 -1
  356. package/dist/lib/tooltip-directive.cjs.map +1 -1
  357. package/dist/lib/tooltip-directive.js +56 -42
  358. package/dist/lib/tooltip-directive.js.map +1 -1
  359. package/dist/lib/tooltip.cjs +460 -1
  360. package/dist/lib/tooltip.cjs.map +1 -1
  361. package/dist/lib/tooltip.js +162 -103
  362. package/dist/lib/tooltip.js.map +1 -1
  363. package/dist/lib/top-banner-info.cjs +71 -1
  364. package/dist/lib/top-banner-info.cjs.map +1 -1
  365. package/dist/lib/top-banner-info.js +27 -22
  366. package/dist/lib/top-banner-info.js.map +1 -1
  367. package/dist/lib/unread-pill.cjs +73 -1
  368. package/dist/lib/unread-pill.cjs.map +1 -1
  369. package/dist/lib/unread-pill.js +28 -25
  370. package/dist/lib/unread-pill.js.map +1 -1
  371. package/dist/lib/validation-messages.cjs +89 -1
  372. package/dist/lib/validation-messages.cjs.map +1 -1
  373. package/dist/lib/validation-messages.js +41 -36
  374. package/dist/lib/validation-messages.js.map +1 -1
  375. package/dist/style.css +1257 -1
  376. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
  377. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
  378. package/package.json +30 -29
  379. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js +0 -2
  380. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js.map +0 -1
  381. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js +0 -10
  382. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js.map +0 -1
  383. package/dist/chunks/dropdown-UO3UJalk.js +0 -2
  384. package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
  385. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
  386. package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
  387. package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
  388. package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
  389. package/dist/chunks/index-6tYeqbgP.js +0 -3
  390. package/dist/chunks/index-IBtQ5jRJ.js +0 -2
  391. package/dist/chunks/index-IBtQ5jRJ.js.map +0 -1
  392. package/dist/chunks/index-b4iXYvId.js +0 -399
  393. package/dist/chunks/index-mRmwpCBG.js +0 -256
  394. package/dist/chunks/index-mRmwpCBG.js.map +0 -1
  395. package/dist/chunks/input-0Uksk4DP.js +0 -2
  396. package/dist/chunks/input_group-AS760Cp7.js +0 -2
  397. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
  398. package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
  399. package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
  400. package/dist/chunks/link_constants-vIUB92L4.js +0 -16
  401. package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
  402. package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
  403. package/dist/chunks/modal-VuMFkZFH.js +0 -82
  404. package/dist/chunks/modal-qEzlo0Sj.js +0 -2
  405. package/dist/chunks/notice_action-jO199emq.js +0 -2
  406. package/dist/chunks/notice_action-tJfD5Qw1.js +0 -209
  407. package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
  408. package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
  409. package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
  410. package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
  411. package/dist/chunks/sr_only_close_button-iD7s1Pbj.js +0 -3
  412. package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
  413. package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
  414. package/dist/chunks/tab-GQZFMq83.js +0 -367
  415. package/dist/chunks/tab-at7WWglk.js +0 -2
  416. package/dist/lib/constants.cjs +0 -2
  417. package/dist/lib/dates.cjs +0 -2
  418. package/dist/lib/dates.js +0 -57
  419. package/dist/lib/mixins.cjs +0 -2
  420. package/dist/lib/mixins.js +0 -17
  421. package/dist/lib/utils.cjs +0 -2
  422. package/dist/lib/utils.js +0 -171
  423. package/dist/lib/validators.cjs +0 -2
  424. package/dist/lib/validators.js +0 -12
  425. /package/dist/{lib → common}/mixins.js.map +0 -0
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const dateFns = require("date-fns");
4
+ const common_utils = require("./utils.cjs");
5
+ require("./constants.cjs");
6
+ require("vue");
7
+ let dialtoneLocale;
8
+ function _baseFormat(date, formatString) {
9
+ _checkLocaleSet();
10
+ return dateFns.format(date, formatString, {
11
+ locale: dialtoneLocale
12
+ });
13
+ }
14
+ function _baseFormatDuration(duration, formatString) {
15
+ _checkLocaleSet();
16
+ return dateFns.formatDuration(duration, {
17
+ locale: dialtoneLocale,
18
+ format: formatString
19
+ });
20
+ }
21
+ function _baseFormatDistance(date, baseDate) {
22
+ _checkLocaleSet();
23
+ return dateFns.formatDistance(date, baseDate, {
24
+ locale: dialtoneLocale
25
+ });
26
+ }
27
+ function _isLocaleSet() {
28
+ return dialtoneLocale !== void 0;
29
+ }
30
+ function _checkLocaleSet() {
31
+ if (!_isLocaleSet()) {
32
+ throw new Error("Locale not set, please call setDateLocale(locale) and pass in a datefns locale object as the locale param before calling this function");
33
+ }
34
+ }
35
+ function setDateLocale(locale) {
36
+ dialtoneLocale = locale;
37
+ }
38
+ function getDateMedium(date) {
39
+ return _baseFormat(date, "MMMM d, y");
40
+ }
41
+ function durationInHHMM(durationInSeconds) {
42
+ if (durationInSeconds < 60) {
43
+ return _baseFormatDistance(0, 29 * 1e3);
44
+ }
45
+ const duration = dateFns.intervalToDuration({
46
+ start: 0,
47
+ end: durationInSeconds * 1e3
48
+ });
49
+ return _baseFormatDuration(duration, ["hours", "minutes"]);
50
+ }
51
+ function _getRelativeDaysText(days) {
52
+ const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: "auto" });
53
+ return common_utils.capitalizeFirstLetter(rtl.formatToParts(days, "day")[0].value, dialtoneLocale.code);
54
+ }
55
+ function relativeDate(date) {
56
+ if (dateFns.isToday(date)) {
57
+ return _getRelativeDaysText(0);
58
+ } else if (dateFns.isYesterday(date)) {
59
+ return _getRelativeDaysText(-1);
60
+ } else if (dateFns.isThisWeek(date)) {
61
+ return _baseFormat(date, "EEEE");
62
+ } else if (dateFns.isThisYear(date)) {
63
+ return _baseFormat(date, "EEEE, MMMM d");
64
+ } else {
65
+ return _baseFormat(date, "MMMM d, y");
66
+ }
67
+ }
68
+ exports.durationInHHMM = durationInHHMM;
69
+ exports.getDateMedium = getDateMedium;
70
+ exports.relativeDate = relativeDate;
71
+ exports.setDateLocale = setDateLocale;
72
+ //# sourceMappingURL=dates.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dates.cjs","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["dialtoneLocale","_baseFormat","date","formatString","_checkLocaleSet","format","_baseFormatDuration","duration","formatDuration","_baseFormatDistance","baseDate","formatDistance","_isLocaleSet","setDateLocale","locale","getDateMedium","durationInHHMM","durationInSeconds","intervalToDuration","_getRelativeDaysText","days","rtl","capitalizeFirstLetter","relativeDate","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":"+KAYA,IAAIA,EAIJ,SAASC,EAAaC,EAAMC,EAAc,CACxC,OAAAC,IACOC,EAAM,OAACH,EAAMC,EAAc,CAChC,OAAQH,CACZ,CAAG,CACH,CAEA,SAASM,EAAqBC,EAAUJ,EAAc,CACpD,OAAAC,IACOI,EAAAA,eAAeD,EAAU,CAC9B,OAAQP,EACR,OAAQG,CACZ,CAAG,CACH,CAEA,SAASM,EAAqBP,EAAMQ,EAAU,CAC5C,OAAAN,IACOO,EAAc,eAACT,EAAMQ,EAAU,CACpC,OAAQV,CACZ,CAAG,CACH,CAEA,SAASY,GAAgB,CACvB,OAAOZ,IAAmB,MAC5B,CAEA,SAASI,GAAmB,CAC1B,GAAI,CAACQ,EAAY,EACf,MAAM,IAAI,MAAM,wIAC6D,CAEjF,CAMO,SAASC,EAAeC,EAAQ,CACrCd,EAAiBc,CACnB,CAQO,SAASC,EAAeb,EAAM,CACnC,OAAOD,EAAYC,EAAM,WAAW,CACtC,CAQO,SAASc,EAAgBC,EAAmB,CACjD,GAAIA,EAAoB,GAGtB,OAAOR,EAAoB,EAAG,GAAK,GAAI,EAEzC,MAAMF,EAAWW,EAAAA,mBAAmB,CAClC,MAAO,EACP,IAAKD,EAAoB,GAC7B,CAAG,EACD,OAAOX,EAAoBC,EAAU,CAAC,QAAS,SAAS,CAAC,CAC3D,CAQA,SAASY,EAAsBC,EAAM,CACnC,MAAMC,EAAM,IAAI,KAAK,mBAAmBrB,EAAe,KAAM,CAAE,QAAS,MAAM,CAAE,EAChF,OAAOsB,wBAAsBD,EAAI,cAAcD,EAAM,KAAK,EAAE,CAAC,EAAE,MAAOpB,EAAe,IAAI,CAC3F,CA8BO,SAASuB,EAAcrB,EAAM,CAClC,OAAIsB,EAAAA,QAAQtB,CAAI,EACPiB,EAAqB,CAAC,EACpBM,EAAAA,YAAYvB,CAAI,EAClBiB,EAAqB,EAAE,EACrBO,EAAAA,WAAWxB,CAAI,EACjBD,EAAYC,EAAM,MAAM,EACtByB,EAAAA,WAAWzB,CAAI,EACjBD,EAAYC,EAAM,cAAc,EAEhCD,EAAYC,EAAM,WAAW,CAExC"}
1
+ {"version":3,"file":"dates.cjs","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["format","formatDuration","formatDistance","intervalToDuration","capitalizeFirstLetter","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;;;AAYA,IAAI;AAIJ,SAAS,YAAa,MAAM,cAAc;AACxC;AACA,SAAOA,QAAM,OAAC,MAAM,cAAc;AAAA,IAChC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,UAAU,cAAc;AACpD;AACA,SAAOC,QAAAA,eAAe,UAAU;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,MAAM,UAAU;AAC5C;AACA,SAAOC,QAAc,eAAC,MAAM,UAAU;AAAA,IACpC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,eAAgB;AACvB,SAAO,mBAAmB;AAC5B;AAEA,SAAS,kBAAmB;AAC1B,MAAI,CAAC,aAAY,GAAI;AACnB,UAAM,IAAI,MAAM,wIAC6D;AAAA,EAC9E;AACH;AAMO,SAAS,cAAe,QAAQ;AACrC,mBAAiB;AACnB;AAQO,SAAS,cAAe,MAAM;AACnC,SAAO,YAAY,MAAM,WAAW;AACtC;AAQO,SAAS,eAAgB,mBAAmB;AACjD,MAAI,oBAAoB,IAAI;AAG1B,WAAO,oBAAoB,GAAG,KAAK,GAAI;AAAA,EACxC;AACD,QAAM,WAAWC,QAAAA,mBAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAK,oBAAoB;AAAA,EAC7B,CAAG;AACD,SAAO,oBAAoB,UAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAAS,qBAAsB,MAAM;AACnC,QAAM,MAAM,IAAI,KAAK,mBAAmB,eAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAOC,mCAAsB,IAAI,cAAc,MAAM,KAAK,EAAE,CAAC,EAAE,OAAO,eAAe,IAAI;AAC3F;AA8BO,SAAS,aAAc,MAAM;AAClC,MAAIC,QAAAA,QAAQ,IAAI,GAAG;AACjB,WAAO,qBAAqB,CAAC;AAAA,EACjC,WAAaC,QAAAA,YAAY,IAAI,GAAG;AAC5B,WAAO,qBAAqB,EAAE;AAAA,EAClC,WAAaC,QAAAA,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,MAAM;AAAA,EACnC,WAAaC,QAAAA,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,cAAc;AAAA,EAC3C,OAAS;AACL,WAAO,YAAY,MAAM,WAAW;AAAA,EACrC;AACH;;;;;"}
@@ -0,0 +1,72 @@
1
+ import { intervalToDuration, isToday, isYesterday, isThisWeek, isThisYear, format, formatDuration, formatDistance } from "date-fns";
2
+ import { capitalizeFirstLetter } from "./utils.js";
3
+ import "./constants.js";
4
+ import "vue";
5
+ let dialtoneLocale;
6
+ function _baseFormat(date, formatString) {
7
+ _checkLocaleSet();
8
+ return format(date, formatString, {
9
+ locale: dialtoneLocale
10
+ });
11
+ }
12
+ function _baseFormatDuration(duration, formatString) {
13
+ _checkLocaleSet();
14
+ return formatDuration(duration, {
15
+ locale: dialtoneLocale,
16
+ format: formatString
17
+ });
18
+ }
19
+ function _baseFormatDistance(date, baseDate) {
20
+ _checkLocaleSet();
21
+ return formatDistance(date, baseDate, {
22
+ locale: dialtoneLocale
23
+ });
24
+ }
25
+ function _isLocaleSet() {
26
+ return dialtoneLocale !== void 0;
27
+ }
28
+ function _checkLocaleSet() {
29
+ if (!_isLocaleSet()) {
30
+ throw new Error("Locale not set, please call setDateLocale(locale) and pass in a datefns locale object as the locale param before calling this function");
31
+ }
32
+ }
33
+ function setDateLocale(locale) {
34
+ dialtoneLocale = locale;
35
+ }
36
+ function getDateMedium(date) {
37
+ return _baseFormat(date, "MMMM d, y");
38
+ }
39
+ function durationInHHMM(durationInSeconds) {
40
+ if (durationInSeconds < 60) {
41
+ return _baseFormatDistance(0, 29 * 1e3);
42
+ }
43
+ const duration = intervalToDuration({
44
+ start: 0,
45
+ end: durationInSeconds * 1e3
46
+ });
47
+ return _baseFormatDuration(duration, ["hours", "minutes"]);
48
+ }
49
+ function _getRelativeDaysText(days) {
50
+ const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: "auto" });
51
+ return capitalizeFirstLetter(rtl.formatToParts(days, "day")[0].value, dialtoneLocale.code);
52
+ }
53
+ function relativeDate(date) {
54
+ if (isToday(date)) {
55
+ return _getRelativeDaysText(0);
56
+ } else if (isYesterday(date)) {
57
+ return _getRelativeDaysText(-1);
58
+ } else if (isThisWeek(date)) {
59
+ return _baseFormat(date, "EEEE");
60
+ } else if (isThisYear(date)) {
61
+ return _baseFormat(date, "EEEE, MMMM d");
62
+ } else {
63
+ return _baseFormat(date, "MMMM d, y");
64
+ }
65
+ }
66
+ export {
67
+ durationInHHMM,
68
+ getDateMedium,
69
+ relativeDate,
70
+ setDateLocale
71
+ };
72
+ //# sourceMappingURL=dates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dates.js","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["dialtoneLocale","_baseFormat","date","formatString","_checkLocaleSet","format","_baseFormatDuration","duration","formatDuration","_baseFormatDistance","baseDate","formatDistance","_isLocaleSet","setDateLocale","locale","getDateMedium","durationInHHMM","durationInSeconds","intervalToDuration","_getRelativeDaysText","days","rtl","capitalizeFirstLetter","relativeDate","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;AAYA,IAAIA;AAIJ,SAASC,EAAaC,GAAMC,GAAc;AACxC,SAAAC,KACOC,EAAOH,GAAMC,GAAc;AAAA,IAChC,QAAQH;AAAA,EACZ,CAAG;AACH;AAEA,SAASM,EAAqBC,GAAUJ,GAAc;AACpD,SAAAC,KACOI,EAAeD,GAAU;AAAA,IAC9B,QAAQP;AAAA,IACR,QAAQG;AAAA,EACZ,CAAG;AACH;AAEA,SAASM,EAAqBP,GAAMQ,GAAU;AAC5C,SAAAN,KACOO,EAAeT,GAAMQ,GAAU;AAAA,IACpC,QAAQV;AAAA,EACZ,CAAG;AACH;AAEA,SAASY,IAAgB;AACvB,SAAOZ,MAAmB;AAC5B;AAEA,SAASI,IAAmB;AAC1B,MAAI,CAACQ,EAAY;AACf,UAAM,IAAI,MAAM,wIAC6D;AAEjF;AAMO,SAASC,EAAeC,GAAQ;AACrC,EAAAd,IAAiBc;AACnB;AAQO,SAASC,EAAeb,GAAM;AACnC,SAAOD,EAAYC,GAAM,WAAW;AACtC;AAQO,SAASc,EAAgBC,GAAmB;AACjD,MAAIA,IAAoB;AAGtB,WAAOR,EAAoB,GAAG,KAAK,GAAI;AAEzC,QAAMF,IAAWW,EAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAKD,IAAoB;AAAA,EAC7B,CAAG;AACD,SAAOX,EAAoBC,GAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAASY,EAAsBC,GAAM;AACnC,QAAMC,IAAM,IAAI,KAAK,mBAAmBrB,EAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAOsB,EAAsBD,EAAI,cAAcD,GAAM,KAAK,EAAE,CAAC,EAAE,OAAOpB,EAAe,IAAI;AAC3F;AA8BO,SAASuB,EAAcrB,GAAM;AAClC,SAAIsB,EAAQtB,CAAI,IACPiB,EAAqB,CAAC,IACpBM,EAAYvB,CAAI,IAClBiB,EAAqB,EAAE,IACrBO,EAAWxB,CAAI,IACjBD,EAAYC,GAAM,MAAM,IACtByB,EAAWzB,CAAI,IACjBD,EAAYC,GAAM,cAAc,IAEhCD,EAAYC,GAAM,WAAW;AAExC;"}
1
+ {"version":3,"file":"dates.js","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":[],"mappings":";;;;AAYA,IAAI;AAIJ,SAAS,YAAa,MAAM,cAAc;AACxC;AACA,SAAO,OAAO,MAAM,cAAc;AAAA,IAChC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,UAAU,cAAc;AACpD;AACA,SAAO,eAAe,UAAU;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,MAAM,UAAU;AAC5C;AACA,SAAO,eAAe,MAAM,UAAU;AAAA,IACpC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,eAAgB;AACvB,SAAO,mBAAmB;AAC5B;AAEA,SAAS,kBAAmB;AAC1B,MAAI,CAAC,aAAY,GAAI;AACnB,UAAM,IAAI,MAAM,wIAC6D;AAAA,EAC9E;AACH;AAMO,SAAS,cAAe,QAAQ;AACrC,mBAAiB;AACnB;AAQO,SAAS,cAAe,MAAM;AACnC,SAAO,YAAY,MAAM,WAAW;AACtC;AAQO,SAAS,eAAgB,mBAAmB;AACjD,MAAI,oBAAoB,IAAI;AAG1B,WAAO,oBAAoB,GAAG,KAAK,GAAI;AAAA,EACxC;AACD,QAAM,WAAW,mBAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAK,oBAAoB;AAAA,EAC7B,CAAG;AACD,SAAO,oBAAoB,UAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAAS,qBAAsB,MAAM;AACnC,QAAM,MAAM,IAAI,KAAK,mBAAmB,eAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAO,sBAAsB,IAAI,cAAc,MAAM,KAAK,EAAE,CAAC,EAAE,OAAO,eAAe,IAAI;AAC3F;AA8BO,SAAS,aAAc,MAAM;AAClC,MAAI,QAAQ,IAAI,GAAG;AACjB,WAAO,qBAAqB,CAAC;AAAA,EACjC,WAAa,YAAY,IAAI,GAAG;AAC5B,WAAO,qBAAqB,EAAE;AAAA,EAClC,WAAa,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,MAAM;AAAA,EACnC,WAAa,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,cAAc;AAAA,EAC3C,OAAS;AACL,WAAO,YAAY,MAAM,WAAW;AAAA,EACrC;AACH;"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const emojiRegex = require("emoji-regex");
4
+ const dialtoneEmojis = require("@dialpad/dialtone-emojis");
5
+ const emojiVersion = "8.0";
6
+ const defaultEmojiAssetUrl = "https://cdn.jsdelivr.net/joypixels/assets/" + emojiVersion + "/png/unicode/32/";
7
+ exports.customEmojiAssetUrl = null;
8
+ exports.emojiImageUrlSmall = defaultEmojiAssetUrl;
9
+ exports.emojiFileExtensionSmall = ".png";
10
+ exports.emojiImageUrlLarge = defaultEmojiAssetUrl;
11
+ exports.emojiFileExtensionLarge = ".png";
12
+ const emojiJson = dialtoneEmojis.emojisIndexed;
13
+ function getEmojiData() {
14
+ return emojiJson;
15
+ }
16
+ function setEmojiAssetUrlSmall(url, fileExtension = ".png") {
17
+ if (!url.endsWith("/")) {
18
+ url = url + "/";
19
+ }
20
+ exports.emojiImageUrlSmall = url;
21
+ exports.emojiFileExtensionSmall = fileExtension;
22
+ }
23
+ function setEmojiAssetUrlLarge(url, fileExtension = ".svg") {
24
+ if (!url.endsWith("/")) {
25
+ url = url + "/";
26
+ }
27
+ exports.emojiImageUrlLarge = url;
28
+ exports.emojiFileExtensionLarge = fileExtension;
29
+ }
30
+ function setCustomEmojiUrl(url) {
31
+ exports.customEmojiAssetUrl = url;
32
+ }
33
+ function setCustomEmojiJson(json) {
34
+ validateCustomEmojiJson(json);
35
+ }
36
+ function validateCustomEmojiJson(json) {
37
+ const customEmojiProps = ["extension", "custom"];
38
+ const customEmojiRequiredProps = [
39
+ "name",
40
+ "category",
41
+ "shortname",
42
+ "extension",
43
+ "custom"
44
+ ];
45
+ const _updateNativeEmojiData = (emojiData, propName, propValue) => {
46
+ if (emojiData[propName] === void 0) {
47
+ if (!customEmojiProps.includes(propName)) {
48
+ return;
49
+ }
50
+ emojiData[propName] = propValue;
51
+ } else {
52
+ if (Array.isArray(emojiData[propName])) {
53
+ emojiData[propName] = emojiData[propName].concat(propValue);
54
+ } else {
55
+ emojiData[propName] = propValue;
56
+ }
57
+ }
58
+ };
59
+ Object.entries(json).forEach((item) => {
60
+ const [customEmojiKey, customEmojiValue] = item;
61
+ if (customEmojiKey in emojiJson) {
62
+ const emojiData = emojiJson[customEmojiKey];
63
+ for (const customEmojiPropertyName in customEmojiValue) {
64
+ const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];
65
+ _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);
66
+ }
67
+ } else {
68
+ const _validateRequiredProps = () => customEmojiRequiredProps.every((val) => {
69
+ return customEmojiValue[val] !== void 0;
70
+ });
71
+ if (_validateRequiredProps()) {
72
+ emojiJson[customEmojiKey] = customEmojiValue;
73
+ } else {
74
+ console.error(
75
+ "The following custom emoji doesn't contain the required properties:",
76
+ customEmojiValue
77
+ );
78
+ }
79
+ }
80
+ });
81
+ }
82
+ function shortcodeToEmojiData(shortcode) {
83
+ function f(o, key) {
84
+ if (!o || typeof o !== "object") {
85
+ return;
86
+ }
87
+ if ("shortname" in o) {
88
+ if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {
89
+ o.key = key;
90
+ reference = o;
91
+ return true;
92
+ }
93
+ }
94
+ Object.keys(o).some(function(k) {
95
+ return f(o[k], k);
96
+ });
97
+ }
98
+ let reference;
99
+ f(getEmojiData(), null);
100
+ return reference;
101
+ }
102
+ function unicodeToString(emoji) {
103
+ let key = "";
104
+ for (const codePoint of emoji) {
105
+ const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, "0");
106
+ if (["200d", "fe0f"].includes(codepoint))
107
+ continue;
108
+ if (key !== "") {
109
+ key = key + "-";
110
+ }
111
+ key = key + codepoint;
112
+ }
113
+ return key;
114
+ }
115
+ function stringToUnicode(str) {
116
+ const uChars = str.split("-");
117
+ let result = "";
118
+ uChars.forEach((uChar) => {
119
+ result = result + String.fromCodePoint(parseInt(uChar, 16));
120
+ });
121
+ return result;
122
+ }
123
+ function codeToEmojiData(code) {
124
+ if (code.startsWith(":") && code.endsWith(":")) {
125
+ return shortcodeToEmojiData(code);
126
+ } else {
127
+ const unicodeString = unicodeToString(code);
128
+ const result = emojiJson[unicodeString];
129
+ if (result)
130
+ result.key = unicodeString;
131
+ return result;
132
+ }
133
+ }
134
+ function findShortCodes(textContent) {
135
+ const shortcodes = textContent.match(/:\w+:/g);
136
+ return filterValidShortCodes(shortcodes);
137
+ }
138
+ function filterValidShortCodes(shortcodes) {
139
+ const filtered = shortcodes ? shortcodes.filter((code) => shortcodeToEmojiData(code)) : [];
140
+ return new Set(filtered);
141
+ }
142
+ function findEmojis(textContent) {
143
+ const matches = [...textContent.matchAll(emojiRegex())];
144
+ const emojis = matches.length ? matches.map((match) => match[0]) : [];
145
+ return new Set(emojis);
146
+ }
147
+ exports.codeToEmojiData = codeToEmojiData;
148
+ exports.defaultEmojiAssetUrl = defaultEmojiAssetUrl;
149
+ exports.emojiJson = emojiJson;
150
+ exports.emojiVersion = emojiVersion;
151
+ exports.filterValidShortCodes = filterValidShortCodes;
152
+ exports.findEmojis = findEmojis;
153
+ exports.findShortCodes = findShortCodes;
154
+ exports.getEmojiData = getEmojiData;
155
+ exports.setCustomEmojiJson = setCustomEmojiJson;
156
+ exports.setCustomEmojiUrl = setCustomEmojiUrl;
157
+ exports.setEmojiAssetUrlLarge = setEmojiAssetUrlLarge;
158
+ exports.setEmojiAssetUrlSmall = setEmojiAssetUrlSmall;
159
+ exports.shortcodeToEmojiData = shortcodeToEmojiData;
160
+ exports.stringToUnicode = stringToUnicode;
161
+ exports.unicodeToString = unicodeToString;
162
+ exports.validateCustomEmojiJson = validateCustomEmojiJson;
163
+ //# sourceMappingURL=emoji.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji.cjs","sources":["../../common/emoji/index.js"],"sourcesContent":["import emojiRegex from 'emoji-regex';\nimport { emojisIndexed } from '@dialpad/dialtone-emojis';\n\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojisIndexed;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'name',\n 'category',\n 'shortname',\n 'extension',\n 'custom',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = textContent.match(/:\\w+:/g);\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex())];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":["customEmojiAssetUrl","emojiImageUrlSmall","emojiFileExtensionSmall","emojiImageUrlLarge","emojiFileExtensionLarge","emojisIndexed"],"mappings":"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"}
@@ -0,0 +1,168 @@
1
+ import emojiRegex from "emoji-regex";
2
+ import { emojisIndexed } from "@dialpad/dialtone-emojis";
3
+ const emojiVersion = "8.0";
4
+ const defaultEmojiAssetUrl = "https://cdn.jsdelivr.net/joypixels/assets/" + emojiVersion + "/png/unicode/32/";
5
+ let customEmojiAssetUrl = null;
6
+ let emojiImageUrlSmall = defaultEmojiAssetUrl;
7
+ let emojiFileExtensionSmall = ".png";
8
+ let emojiImageUrlLarge = defaultEmojiAssetUrl;
9
+ let emojiFileExtensionLarge = ".png";
10
+ const emojiJson = emojisIndexed;
11
+ function getEmojiData() {
12
+ return emojiJson;
13
+ }
14
+ function setEmojiAssetUrlSmall(url, fileExtension = ".png") {
15
+ if (!url.endsWith("/")) {
16
+ url = url + "/";
17
+ }
18
+ emojiImageUrlSmall = url;
19
+ emojiFileExtensionSmall = fileExtension;
20
+ }
21
+ function setEmojiAssetUrlLarge(url, fileExtension = ".svg") {
22
+ if (!url.endsWith("/")) {
23
+ url = url + "/";
24
+ }
25
+ emojiImageUrlLarge = url;
26
+ emojiFileExtensionLarge = fileExtension;
27
+ }
28
+ function setCustomEmojiUrl(url) {
29
+ customEmojiAssetUrl = url;
30
+ }
31
+ function setCustomEmojiJson(json) {
32
+ validateCustomEmojiJson(json);
33
+ }
34
+ function validateCustomEmojiJson(json) {
35
+ const customEmojiProps = ["extension", "custom"];
36
+ const customEmojiRequiredProps = [
37
+ "name",
38
+ "category",
39
+ "shortname",
40
+ "extension",
41
+ "custom"
42
+ ];
43
+ const _updateNativeEmojiData = (emojiData, propName, propValue) => {
44
+ if (emojiData[propName] === void 0) {
45
+ if (!customEmojiProps.includes(propName)) {
46
+ return;
47
+ }
48
+ emojiData[propName] = propValue;
49
+ } else {
50
+ if (Array.isArray(emojiData[propName])) {
51
+ emojiData[propName] = emojiData[propName].concat(propValue);
52
+ } else {
53
+ emojiData[propName] = propValue;
54
+ }
55
+ }
56
+ };
57
+ Object.entries(json).forEach((item) => {
58
+ const [customEmojiKey, customEmojiValue] = item;
59
+ if (customEmojiKey in emojiJson) {
60
+ const emojiData = emojiJson[customEmojiKey];
61
+ for (const customEmojiPropertyName in customEmojiValue) {
62
+ const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];
63
+ _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);
64
+ }
65
+ } else {
66
+ const _validateRequiredProps = () => customEmojiRequiredProps.every((val) => {
67
+ return customEmojiValue[val] !== void 0;
68
+ });
69
+ if (_validateRequiredProps()) {
70
+ emojiJson[customEmojiKey] = customEmojiValue;
71
+ } else {
72
+ console.error(
73
+ "The following custom emoji doesn't contain the required properties:",
74
+ customEmojiValue
75
+ );
76
+ }
77
+ }
78
+ });
79
+ }
80
+ function shortcodeToEmojiData(shortcode) {
81
+ function f(o, key) {
82
+ if (!o || typeof o !== "object") {
83
+ return;
84
+ }
85
+ if ("shortname" in o) {
86
+ if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {
87
+ o.key = key;
88
+ reference = o;
89
+ return true;
90
+ }
91
+ }
92
+ Object.keys(o).some(function(k) {
93
+ return f(o[k], k);
94
+ });
95
+ }
96
+ let reference;
97
+ f(getEmojiData(), null);
98
+ return reference;
99
+ }
100
+ function unicodeToString(emoji) {
101
+ let key = "";
102
+ for (const codePoint of emoji) {
103
+ const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, "0");
104
+ if (["200d", "fe0f"].includes(codepoint))
105
+ continue;
106
+ if (key !== "") {
107
+ key = key + "-";
108
+ }
109
+ key = key + codepoint;
110
+ }
111
+ return key;
112
+ }
113
+ function stringToUnicode(str) {
114
+ const uChars = str.split("-");
115
+ let result = "";
116
+ uChars.forEach((uChar) => {
117
+ result = result + String.fromCodePoint(parseInt(uChar, 16));
118
+ });
119
+ return result;
120
+ }
121
+ function codeToEmojiData(code) {
122
+ if (code.startsWith(":") && code.endsWith(":")) {
123
+ return shortcodeToEmojiData(code);
124
+ } else {
125
+ const unicodeString = unicodeToString(code);
126
+ const result = emojiJson[unicodeString];
127
+ if (result)
128
+ result.key = unicodeString;
129
+ return result;
130
+ }
131
+ }
132
+ function findShortCodes(textContent) {
133
+ const shortcodes = textContent.match(/:\w+:/g);
134
+ return filterValidShortCodes(shortcodes);
135
+ }
136
+ function filterValidShortCodes(shortcodes) {
137
+ const filtered = shortcodes ? shortcodes.filter((code) => shortcodeToEmojiData(code)) : [];
138
+ return new Set(filtered);
139
+ }
140
+ function findEmojis(textContent) {
141
+ const matches = [...textContent.matchAll(emojiRegex())];
142
+ const emojis = matches.length ? matches.map((match) => match[0]) : [];
143
+ return new Set(emojis);
144
+ }
145
+ export {
146
+ codeToEmojiData,
147
+ customEmojiAssetUrl,
148
+ defaultEmojiAssetUrl,
149
+ emojiFileExtensionLarge,
150
+ emojiFileExtensionSmall,
151
+ emojiImageUrlLarge,
152
+ emojiImageUrlSmall,
153
+ emojiJson,
154
+ emojiVersion,
155
+ filterValidShortCodes,
156
+ findEmojis,
157
+ findShortCodes,
158
+ getEmojiData,
159
+ setCustomEmojiJson,
160
+ setCustomEmojiUrl,
161
+ setEmojiAssetUrlLarge,
162
+ setEmojiAssetUrlSmall,
163
+ shortcodeToEmojiData,
164
+ stringToUnicode,
165
+ unicodeToString,
166
+ validateCustomEmojiJson
167
+ };
168
+ //# sourceMappingURL=emoji.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji.js","sources":["../../common/emoji/index.js"],"sourcesContent":["import emojiRegex from 'emoji-regex';\nimport { emojisIndexed } from '@dialpad/dialtone-emojis';\n\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojisIndexed;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'name',\n 'category',\n 'shortname',\n 'extension',\n 'custom',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = textContent.match(/:\\w+:/g);\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex())];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const input = require("../chunks/input-ttnte8zB.js");
4
+ const input_group = require("../chunks/input_group-M-D25pOJ.js");
5
+ const keyboard_list_navigation = require("../chunks/keyboard_list_navigation-fJnl_Iox.js");
6
+ require("vue");
7
+ require("./constants.cjs");
8
+ require("./validators.cjs");
9
+ require("./utils.cjs");
10
+ require("../lib/validation-messages.cjs");
11
+ require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
12
+ exports.DtCheckableInputMixin = input.CheckableMixin;
13
+ exports.DtGroupableInputMixin = input.GroupableMixin;
14
+ exports.DtInputMixin = input.InputMixin;
15
+ exports.DtInputGroupMixin = input_group.InputGroupMixin;
16
+ exports.DtKeyboardListNavigationMixin = keyboard_list_navigation.KeyboardNavigation;
17
+ //# sourceMappingURL=mixins.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mixins.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"mixins.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ import { CheckableMixin, GroupableMixin, InputMixin } from "../chunks/input-NmYDD5bn.js";
2
+ import { InputGroupMixin } from "../chunks/input_group-jWnq2DJT.js";
3
+ import { KeyboardNavigation } from "../chunks/keyboard_list_navigation-ScXhrxya.js";
4
+ import "vue";
5
+ import "./constants.js";
6
+ import "./validators.js";
7
+ import "./utils.js";
8
+ import "../lib/validation-messages.js";
9
+ import "../chunks/_plugin-vue_export-helper-caHeSgYY.js";
10
+ export {
11
+ CheckableMixin as DtCheckableInputMixin,
12
+ GroupableMixin as DtGroupableInputMixin,
13
+ InputGroupMixin as DtInputGroupMixin,
14
+ InputMixin as DtInputMixin,
15
+ KeyboardNavigation as DtKeyboardListNavigationMixin
16
+ };
17
+ //# sourceMappingURL=mixins.js.map