@bigbinary/neeto-molecules 1.1.78 → 1.2.0-beta1

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 (370) hide show
  1. package/README.md +66 -52
  2. package/dist/Breadcrumbs.js +16 -19
  3. package/dist/Breadcrumbs.js.map +1 -1
  4. package/dist/BrowserSupport.js +41 -138
  5. package/dist/BrowserSupport.js.map +1 -1
  6. package/dist/Builder.js +207 -364
  7. package/dist/Builder.js.map +1 -1
  8. package/dist/CalendarView.js +40 -288
  9. package/dist/CalendarView.js.map +1 -1
  10. package/dist/Chevron-c64ff676.js +190 -0
  11. package/dist/Chevron-c64ff676.js.map +1 -0
  12. package/dist/Codeblock.js +26 -209
  13. package/dist/Codeblock.js.map +1 -1
  14. package/dist/Columns.js +16 -240
  15. package/dist/Columns.js.map +1 -1
  16. package/dist/ConfigurePageSidebar.js +97 -0
  17. package/dist/ConfigurePageSidebar.js.map +1 -0
  18. package/dist/ConfirmationModal.js +10 -10
  19. package/dist/ConfirmationModal.js.map +1 -1
  20. package/dist/Container.js +5 -1187
  21. package/dist/Container.js.map +1 -1
  22. package/dist/CopyToClipboardButton.js +26 -155
  23. package/dist/CopyToClipboardButton.js.map +1 -1
  24. package/dist/Currency.js +912 -0
  25. package/dist/Currency.js.map +1 -0
  26. package/dist/CustomDomain.js +37 -633
  27. package/dist/CustomDomain.js.map +1 -1
  28. package/dist/CustomDomainDashboard.js +69 -2192
  29. package/dist/CustomDomainDashboard.js.map +1 -1
  30. package/dist/DateFormat.js +6 -20
  31. package/dist/DateFormat.js.map +1 -1
  32. package/dist/DateRangeFilter.js +19 -75
  33. package/dist/DateRangeFilter.js.map +1 -1
  34. package/dist/DeleteArchiveModal.js +86 -0
  35. package/dist/DeleteArchiveModal.js.map +1 -0
  36. package/dist/DocumentEditor.js +43 -133
  37. package/dist/DocumentEditor.js.map +1 -1
  38. package/dist/DownloadMobileAppCallout.js +4 -4
  39. package/dist/DownloadMobileAppCallout.js.map +1 -1
  40. package/dist/DynamicVariables.js +12 -95
  41. package/dist/DynamicVariables.js.map +1 -1
  42. package/dist/EmailForm.js +79 -1741
  43. package/dist/EmailForm.js.map +1 -1
  44. package/dist/EmailPreview.js +32 -1213
  45. package/dist/EmailPreview.js.map +1 -1
  46. package/dist/EmojiPicker.js +67 -0
  47. package/dist/EmojiPicker.js.map +1 -0
  48. package/dist/EmojiReactions.js +69 -0
  49. package/dist/EmojiReactions.js.map +1 -0
  50. package/dist/ErrorPage.js +17 -26
  51. package/dist/ErrorPage.js.map +1 -1
  52. package/dist/FloatingActionMenu.js +646 -0
  53. package/dist/FloatingActionMenu.js.map +1 -0
  54. package/dist/Header.js +45 -117
  55. package/dist/Header.js.map +1 -1
  56. package/dist/HelpPopover.js +73 -0
  57. package/dist/HelpPopover.js.map +1 -0
  58. package/dist/IconPicker.js +36 -129
  59. package/dist/IconPicker.js.map +1 -1
  60. package/dist/ImageWithFallback.js +8 -144
  61. package/dist/ImageWithFallback.js.map +1 -1
  62. package/dist/InlineInput.js +22 -526
  63. package/dist/InlineInput.js.map +1 -1
  64. package/dist/Insights.js +304 -0
  65. package/dist/Insights.js.map +1 -0
  66. package/dist/IntegrationCard.js +42 -226
  67. package/dist/IntegrationCard.js.map +1 -1
  68. package/dist/IntegrationDisconnectAlert.js +6 -48
  69. package/dist/IntegrationDisconnectAlert.js.map +1 -1
  70. package/dist/IntegrationWalkthroughModal.js +10 -10
  71. package/dist/IntegrationWalkthroughModal.js.map +1 -1
  72. package/dist/IpRestriction.js +74 -221
  73. package/dist/IpRestriction.js.map +1 -1
  74. package/dist/KeyboardShortcuts.js +38 -128
  75. package/dist/KeyboardShortcuts.js.map +1 -1
  76. package/dist/LoginPage.js +39 -459
  77. package/dist/LoginPage.js.map +1 -1
  78. package/dist/MadeWith.js +32 -0
  79. package/dist/MadeWith.js.map +1 -0
  80. package/dist/MenuBar.js +34 -1295
  81. package/dist/MenuBar.js.map +1 -1
  82. package/dist/Metadata.js +65 -86
  83. package/dist/Metadata.js.map +1 -1
  84. package/dist/MoreDropdown.js +48 -107
  85. package/dist/MoreDropdown.js.map +1 -1
  86. package/dist/NavigationHeader.js +51 -730
  87. package/dist/NavigationHeader.js.map +1 -1
  88. package/dist/NeetoWidget.js +148 -316
  89. package/dist/NeetoWidget.js.map +1 -1
  90. package/dist/Onboarding.js +343 -0
  91. package/dist/Onboarding.js.map +1 -0
  92. package/dist/OptionFields.js +507 -0
  93. package/dist/OptionFields.js.map +1 -0
  94. package/dist/PageLoader.js +5 -48
  95. package/dist/PageLoader.js.map +1 -1
  96. package/dist/PhoneNumber.js +122 -201
  97. package/dist/PhoneNumber.js.map +1 -1
  98. package/dist/ProductEmbed.js +767 -0
  99. package/dist/ProductEmbed.js.map +1 -0
  100. package/dist/PublishBlock.js +19 -60
  101. package/dist/PublishBlock.js.map +1 -1
  102. package/dist/PublishYourItem.js +52 -0
  103. package/dist/PublishYourItem.js.map +1 -0
  104. package/dist/Rename.js +127 -394
  105. package/dist/Rename.js.map +1 -1
  106. package/dist/ResponsiveDevicePicker.js +7 -143
  107. package/dist/ResponsiveDevicePicker.js.map +1 -1
  108. package/dist/Schedule.js +131 -365
  109. package/dist/Schedule.js.map +1 -1
  110. package/dist/Scrollable.js +6 -89
  111. package/dist/Scrollable.js.map +1 -1
  112. package/dist/Search.js +54 -157
  113. package/dist/Search.js.map +1 -1
  114. package/dist/Security.js +72 -1567
  115. package/dist/Security.js.map +1 -1
  116. package/dist/SendToFields.js +51 -133
  117. package/dist/SendToFields.js.map +1 -1
  118. package/dist/Settings.js +141 -412
  119. package/dist/Settings.js.map +1 -1
  120. package/dist/ShareRecordingPane.js +189 -0
  121. package/dist/ShareRecordingPane.js.map +1 -0
  122. package/dist/ShareViaEmail.js +126 -551
  123. package/dist/ShareViaEmail.js.map +1 -1
  124. package/dist/ShareViaLink.js +127 -345
  125. package/dist/ShareViaLink.js.map +1 -1
  126. package/dist/Sidebar.js +161 -758
  127. package/dist/Sidebar.js.map +1 -1
  128. package/dist/SubHeader.js +63 -108
  129. package/dist/SubHeader.js.map +1 -1
  130. package/dist/SuffixedInput.js +105 -0
  131. package/dist/SuffixedInput.js.map +1 -0
  132. package/dist/TableWrapper.js +8 -9
  133. package/dist/TableWrapper.js.map +1 -1
  134. package/dist/Taxonomy.js +112 -1774
  135. package/dist/Taxonomy.js.map +1 -1
  136. package/dist/ThemeSidebar.js +159 -776
  137. package/dist/ThemeSidebar.js.map +1 -1
  138. package/dist/TimeFormat.js +8 -44
  139. package/dist/TimeFormat.js.map +1 -1
  140. package/dist/TimezoneMismatchModal.js +49 -84
  141. package/dist/TimezoneMismatchModal.js.map +1 -1
  142. package/dist/ToggleFeatureCard.js +46 -169
  143. package/dist/ToggleFeatureCard.js.map +1 -1
  144. package/dist/cjs/Breadcrumbs.js +49 -0
  145. package/dist/cjs/Breadcrumbs.js.map +1 -0
  146. package/dist/cjs/BrowserSupport.js +329 -0
  147. package/dist/cjs/BrowserSupport.js.map +1 -0
  148. package/dist/cjs/Builder.js +556 -0
  149. package/dist/cjs/Builder.js.map +1 -0
  150. package/dist/cjs/CalendarView.js +299 -0
  151. package/dist/cjs/CalendarView.js.map +1 -0
  152. package/dist/cjs/Chevron-8a4ed9cd.js +203 -0
  153. package/dist/cjs/Chevron-8a4ed9cd.js.map +1 -0
  154. package/dist/cjs/Codeblock.js +58 -0
  155. package/dist/cjs/Codeblock.js.map +1 -0
  156. package/dist/cjs/Columns.js +31 -0
  157. package/dist/cjs/Columns.js.map +1 -0
  158. package/dist/cjs/ConfigurePageSidebar.js +104 -0
  159. package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
  160. package/dist/cjs/ConfirmationModal.js +120 -0
  161. package/dist/cjs/ConfirmationModal.js.map +1 -0
  162. package/dist/cjs/Container.js +36 -0
  163. package/dist/cjs/Container.js.map +1 -0
  164. package/dist/cjs/CopyToClipboardButton.js +86 -0
  165. package/dist/cjs/CopyToClipboardButton.js.map +1 -0
  166. package/dist/cjs/Currency.js +921 -0
  167. package/dist/cjs/Currency.js.map +1 -0
  168. package/dist/cjs/CustomDomain.js +125 -0
  169. package/dist/cjs/CustomDomain.js.map +1 -0
  170. package/dist/cjs/CustomDomainDashboard.js +200 -0
  171. package/dist/cjs/CustomDomainDashboard.js.map +1 -0
  172. package/dist/cjs/DateFormat.js +40 -0
  173. package/dist/cjs/DateFormat.js.map +1 -0
  174. package/dist/cjs/DateRangeFilter.js +180 -0
  175. package/dist/cjs/DateRangeFilter.js.map +1 -0
  176. package/dist/cjs/DeleteArchiveModal.js +92 -0
  177. package/dist/cjs/DeleteArchiveModal.js.map +1 -0
  178. package/dist/cjs/DocumentEditor.js +194 -0
  179. package/dist/cjs/DocumentEditor.js.map +1 -0
  180. package/dist/cjs/DownloadMobileAppCallout.js +45 -0
  181. package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
  182. package/dist/cjs/DynamicVariables.js +106 -0
  183. package/dist/cjs/DynamicVariables.js.map +1 -0
  184. package/dist/cjs/EmailForm.js +395 -0
  185. package/dist/cjs/EmailForm.js.map +1 -0
  186. package/dist/cjs/EmailPreview.js +139 -0
  187. package/dist/cjs/EmailPreview.js.map +1 -0
  188. package/dist/cjs/EmojiPicker.js +75 -0
  189. package/dist/cjs/EmojiPicker.js.map +1 -0
  190. package/dist/cjs/EmojiReactions.js +76 -0
  191. package/dist/cjs/EmojiReactions.js.map +1 -0
  192. package/dist/cjs/ErrorPage.js +179 -0
  193. package/dist/cjs/ErrorPage.js.map +1 -0
  194. package/dist/cjs/FloatingActionMenu.js +675 -0
  195. package/dist/cjs/FloatingActionMenu.js.map +1 -0
  196. package/dist/cjs/Header.js +104 -0
  197. package/dist/cjs/Header.js.map +1 -0
  198. package/dist/cjs/HelpPopover.js +80 -0
  199. package/dist/cjs/HelpPopover.js.map +1 -0
  200. package/dist/cjs/IconPicker.js +228 -0
  201. package/dist/cjs/IconPicker.js.map +1 -0
  202. package/dist/cjs/ImageWithFallback.js +52 -0
  203. package/dist/cjs/ImageWithFallback.js.map +1 -0
  204. package/dist/cjs/InlineInput.js +233 -0
  205. package/dist/cjs/InlineInput.js.map +1 -0
  206. package/dist/cjs/Insights.js +310 -0
  207. package/dist/cjs/Insights.js.map +1 -0
  208. package/dist/cjs/IntegrationCard.js +208 -0
  209. package/dist/cjs/IntegrationCard.js.map +1 -0
  210. package/dist/cjs/IntegrationDisconnectAlert.js +48 -0
  211. package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
  212. package/dist/cjs/IntegrationWalkthroughModal.js +51 -0
  213. package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
  214. package/dist/cjs/IpRestriction.js +525 -0
  215. package/dist/cjs/IpRestriction.js.map +1 -0
  216. package/dist/cjs/KeyboardShortcuts.js +282 -0
  217. package/dist/cjs/KeyboardShortcuts.js.map +1 -0
  218. package/dist/cjs/LoginPage.js +198 -0
  219. package/dist/cjs/LoginPage.js.map +1 -0
  220. package/dist/cjs/MadeWith.js +38 -0
  221. package/dist/cjs/MadeWith.js.map +1 -0
  222. package/dist/cjs/MenuBar.js +208 -0
  223. package/dist/cjs/MenuBar.js.map +1 -0
  224. package/dist/cjs/Metadata.js +195 -0
  225. package/dist/cjs/Metadata.js.map +1 -0
  226. package/dist/cjs/MoreDropdown.js +152 -0
  227. package/dist/cjs/MoreDropdown.js.map +1 -0
  228. package/dist/cjs/NavigationHeader.js +177 -0
  229. package/dist/cjs/NavigationHeader.js.map +1 -0
  230. package/dist/cjs/NeetoWidget.js +912 -0
  231. package/dist/cjs/NeetoWidget.js.map +1 -0
  232. package/dist/cjs/Onboarding.js +357 -0
  233. package/dist/cjs/Onboarding.js.map +1 -0
  234. package/dist/cjs/OptionFields.js +514 -0
  235. package/dist/cjs/OptionFields.js.map +1 -0
  236. package/dist/cjs/PageLoader.js +116 -0
  237. package/dist/cjs/PageLoader.js.map +1 -0
  238. package/dist/cjs/PhoneNumber.js +363 -0
  239. package/dist/cjs/PhoneNumber.js.map +1 -0
  240. package/dist/cjs/ProductEmbed.js +774 -0
  241. package/dist/cjs/ProductEmbed.js.map +1 -0
  242. package/dist/cjs/PublishBlock.js +125 -0
  243. package/dist/cjs/PublishBlock.js.map +1 -0
  244. package/dist/cjs/PublishYourItem.js +59 -0
  245. package/dist/cjs/PublishYourItem.js.map +1 -0
  246. package/dist/cjs/Rename.js +350 -0
  247. package/dist/cjs/Rename.js.map +1 -0
  248. package/dist/cjs/ResponsiveDevicePicker.js +64 -0
  249. package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
  250. package/dist/cjs/Schedule.js +889 -0
  251. package/dist/cjs/Schedule.js.map +1 -0
  252. package/dist/cjs/Scrollable.js +46 -0
  253. package/dist/cjs/Scrollable.js.map +1 -0
  254. package/dist/cjs/Search.js +117 -0
  255. package/dist/cjs/Search.js.map +1 -0
  256. package/dist/cjs/Security.js +376 -0
  257. package/dist/cjs/Security.js.map +1 -0
  258. package/dist/cjs/SendToFields.js +272 -0
  259. package/dist/cjs/SendToFields.js.map +1 -0
  260. package/dist/cjs/Settings.js +214 -0
  261. package/dist/cjs/Settings.js.map +1 -0
  262. package/dist/cjs/ShareRecordingPane.js +195 -0
  263. package/dist/cjs/ShareRecordingPane.js.map +1 -0
  264. package/dist/cjs/ShareViaEmail.js +348 -0
  265. package/dist/cjs/ShareViaEmail.js.map +1 -0
  266. package/dist/cjs/ShareViaLink.js +507 -0
  267. package/dist/cjs/ShareViaLink.js.map +1 -0
  268. package/dist/cjs/Sidebar.js +288 -0
  269. package/dist/cjs/Sidebar.js.map +1 -0
  270. package/dist/cjs/SubHeader.js +178 -0
  271. package/dist/cjs/SubHeader.js.map +1 -0
  272. package/dist/cjs/SuffixedInput.js +111 -0
  273. package/dist/cjs/SuffixedInput.js.map +1 -0
  274. package/dist/cjs/TableWrapper.js +32 -0
  275. package/dist/cjs/TableWrapper.js.map +1 -0
  276. package/dist/cjs/Taxonomy.js +442 -0
  277. package/dist/cjs/Taxonomy.js.map +1 -0
  278. package/dist/cjs/ThemeSidebar.js +1436 -0
  279. package/dist/cjs/ThemeSidebar.js.map +1 -0
  280. package/dist/cjs/TimeFormat.js +15 -0
  281. package/dist/cjs/TimeFormat.js.map +1 -0
  282. package/dist/cjs/TimezoneMismatchModal.js +143 -0
  283. package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
  284. package/dist/cjs/ToggleFeatureCard.js +209 -0
  285. package/dist/cjs/ToggleFeatureCard.js.map +1 -0
  286. package/dist/cjs/defineProperty-886ed289.js +47 -0
  287. package/dist/cjs/defineProperty-886ed289.js.map +1 -0
  288. package/dist/cjs/extends-1b35a664.js +19 -0
  289. package/dist/cjs/extends-1b35a664.js.map +1 -0
  290. package/dist/cjs/index-00fdb8c2.js +542 -0
  291. package/dist/cjs/index-00fdb8c2.js.map +1 -0
  292. package/dist/cjs/index-248c4f4c.js +1186 -0
  293. package/dist/cjs/index-248c4f4c.js.map +1 -0
  294. package/dist/cjs/index-c55ad2bc.js +375 -0
  295. package/dist/cjs/index-c55ad2bc.js.map +1 -0
  296. package/dist/cjs/inject-css-80a5faa3.js +6 -0
  297. package/dist/cjs/inject-css-80a5faa3.js.map +1 -0
  298. package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
  299. package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
  300. package/dist/cjs/slicedToArray-f320d9e7.js +61 -0
  301. package/dist/cjs/slicedToArray-f320d9e7.js.map +1 -0
  302. package/dist/cjs/toConsumableArray-9abb3858.js +22 -0
  303. package/dist/cjs/toConsumableArray-9abb3858.js.map +1 -0
  304. package/dist/cjs/useColumns-a1c3668f.js +271 -0
  305. package/dist/cjs/useColumns-a1c3668f.js.map +1 -0
  306. package/dist/defineProperty-549061a7.js +43 -0
  307. package/dist/defineProperty-549061a7.js.map +1 -0
  308. package/dist/extends-093996c9.js +17 -0
  309. package/dist/extends-093996c9.js.map +1 -0
  310. package/dist/index-90c89467.js +509 -0
  311. package/dist/index-90c89467.js.map +1 -0
  312. package/dist/index-9720867c.js +372 -0
  313. package/dist/index-9720867c.js.map +1 -0
  314. package/dist/index-e5588516.js +1184 -0
  315. package/dist/index-e5588516.js.map +1 -0
  316. package/dist/inject-css-c86de496.js +4 -0
  317. package/dist/inject-css-c86de496.js.map +1 -0
  318. package/dist/objectWithoutProperties-a0edb288.js +31 -0
  319. package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
  320. package/dist/slicedToArray-b4278ecd.js +57 -0
  321. package/dist/slicedToArray-b4278ecd.js.map +1 -0
  322. package/dist/toConsumableArray-1cc38429.js +20 -0
  323. package/dist/toConsumableArray-1cc38429.js.map +1 -0
  324. package/dist/useColumns-d17d1f72.js +258 -0
  325. package/dist/useColumns-d17d1f72.js.map +1 -0
  326. package/package.json +29 -17
  327. package/src/translations/de.json +7 -0
  328. package/src/translations/en.json +191 -31
  329. package/src/translations/es.json +7 -0
  330. package/src/translations/fr.json +7 -0
  331. package/src/translations/nl.json +7 -0
  332. package/src/translations/pl.json +7 -0
  333. package/src/translations/pt.json +7 -0
  334. package/types/Breadcrumbs.d.ts +1 -0
  335. package/types/Builder.d.ts +61 -12
  336. package/types/Columns.d.ts +112 -5
  337. package/types/ConfigurePageSidebar.d.ts +43 -0
  338. package/types/CopyToClipboardButton.d.ts +3 -0
  339. package/types/Currency.d.ts +48 -0
  340. package/types/CustomDomain.d.ts +2 -0
  341. package/types/CustomDomainDashboard.d.ts +14 -0
  342. package/types/DateRangeFilter.d.ts +2 -0
  343. package/types/DeleteArchiveModal.d.ts +60 -0
  344. package/types/EmailForm.d.ts +1 -1
  345. package/types/EmojiPicker.d.ts +33 -0
  346. package/types/EmojiReactions.d.ts +60 -0
  347. package/types/ErrorPage.d.ts +1 -0
  348. package/types/FloatingActionMenu.d.ts +56 -0
  349. package/types/Header.d.ts +2 -1
  350. package/types/HelpPopover.d.ts +42 -0
  351. package/types/Insights.d.ts +108 -0
  352. package/types/IntegrationCard.d.ts +2 -0
  353. package/types/KeyboardShortcuts.d.ts +2 -2
  354. package/types/MadeWith.d.ts +16 -0
  355. package/types/MoreDropdown.d.ts +4 -1
  356. package/types/NavigationHeader.d.ts +3 -1
  357. package/types/Onboarding.d.ts +63 -0
  358. package/types/OptionFields.d.ts +63 -0
  359. package/types/PhoneNumber.d.ts +6 -2
  360. package/types/ProductEmbed.d.ts +43 -0
  361. package/types/Rename.d.ts +4 -1
  362. package/types/Schedule.d.ts +2 -0
  363. package/types/Search.d.ts +2 -0
  364. package/types/Settings.d.ts +13 -10
  365. package/types/ShareRecordingPane.d.ts +50 -0
  366. package/types/ShareViaLink.d.ts +15 -4
  367. package/types/Sidebar.d.ts +16 -32
  368. package/types/SubHeader.d.ts +0 -1
  369. package/types/SuffixedInput.d.ts +43 -0
  370. package/types/ToggleFeatureCard.d.ts +8 -1
package/dist/EmailForm.js CHANGED
@@ -1,62 +1,29 @@
1
- import React, { useState, useRef, useContext } from 'react';
1
+ export { default as EmailPreview } from './EmailPreview.js';
2
+ import { _ as _defineProperty } from './defineProperty-549061a7.js';
3
+ import React__default, { useState, useContext } from 'react';
2
4
  import classnames from 'classnames';
3
5
  import { useFormikContext, Field } from 'formik';
4
- import { isNotEmpty, noop, isPresent } from '@bigbinary/neeto-cist';
5
- import { isEditorEmpty, FormikEditor, EditorContent } from '@bigbinary/neeto-editor';
6
- import { Callout, Button, Typography, Pane, Toastr, Input as Input$1 } from '@bigbinary/neetoui';
7
- import { Select, Input, MultiEmailInput, Radio, ActionBlock, Form } from '@bigbinary/neetoui/formik';
6
+ import { isNotEmpty, noop } from '@bigbinary/neeto-cist';
7
+ import { isEditorEmpty, FormikEditor } from '@bigbinary/neeto-editor';
8
+ import { Input as Input$1, Typography } from '@bigbinary/neetoui';
9
+ import { Select, Input, Radio, ActionBlock, Form } from '@bigbinary/neetoui/formik';
8
10
  import { useTranslation, Trans } from 'react-i18next';
9
11
  import { t } from 'i18next';
10
12
  import { prop } from 'ramda';
11
13
  import * as yup from 'yup';
12
- import { string } from 'yup';
13
- import { Info, Download, Upload } from '@bigbinary/neeto-icons';
14
- import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
15
- import { useDropzone } from 'react-dropzone';
16
- import Papa from 'papaparse';
17
- import { withEventTargetValue } from '@bigbinary/neeto-commons-frontend/utils';
18
- import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
19
-
20
- function _typeof(o) {
21
- "@babel/helpers - typeof";
22
-
23
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
24
- return typeof o;
25
- } : function (o) {
26
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
27
- }, _typeof(o);
28
- }
29
-
30
- function _toPrimitive(input, hint) {
31
- if (_typeof(input) !== "object" || input === null) return input;
32
- var prim = input[Symbol.toPrimitive];
33
- if (prim !== undefined) {
34
- var res = prim.call(input, hint || "default");
35
- if (_typeof(res) !== "object") return res;
36
- throw new TypeError("@@toPrimitive must return a primitive value.");
37
- }
38
- return (hint === "string" ? String : Number)(input);
39
- }
40
-
41
- function _toPropertyKey(arg) {
42
- var key = _toPrimitive(arg, "string");
43
- return _typeof(key) === "symbol" ? key : String(key);
44
- }
45
-
46
- function _defineProperty(obj, key, value) {
47
- key = _toPropertyKey(key);
48
- if (key in obj) {
49
- Object.defineProperty(obj, key, {
50
- value: value,
51
- enumerable: true,
52
- configurable: true,
53
- writable: true
54
- });
55
- } else {
56
- obj[key] = value;
57
- }
58
- return obj;
59
- }
14
+ import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
15
+ import SendToFields from './SendToFields.js';
16
+ import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
17
+ import { withEventTargetValue } from '@bigbinary/neeto-commons-frontend/utils/general';
18
+ import DynamicVariables from './DynamicVariables.js';
19
+ import './index-e5588516.js';
20
+ import './extends-093996c9.js';
21
+ import './toConsumableArray-1cc38429.js';
22
+ import '@bigbinary/neeto-icons';
23
+ import 'react-dropzone';
24
+ import 'papaparse';
25
+ import './objectWithoutProperties-a0edb288.js';
26
+ import './inject-css-c86de496.js';
60
27
 
61
28
  var INITIAL_FORM_VALUES = {
62
29
  sendTo: [],
@@ -74,13 +41,22 @@ var EMAIL_FORM_VALIDATION_SCHEMA = yup.object({
74
41
  return !isEditorEmpty(value);
75
42
  })
76
43
  });
77
- var SEND_TO_FIELD_VALIDATION = yup.object({
78
- sendTo: yup.array().min(1, t("neetoMolecules.emailForm.errors.required", {
79
- entity: t("neetoMolecules.emailForm.fields.sendToEmailAddress")
80
- })).test("all-emails-valid", t("neetoMolecules.emailForm.errors.invalidEmailAddress"), function (emails) {
44
+ var sendToFieldValidation = function sendToFieldValidation(maxEmails) {
45
+ var validation = yup.array().test("all-emails-valid", t("neetoMolecules.emailForm.errors.invalidEmailAddress"), function (emails) {
81
46
  return emails === null || emails === void 0 ? void 0 : emails.every(prop("valid"));
82
- }).nullable()
83
- });
47
+ }).test("max-email-count", t("neetoMolecules.emailForm.errors.maxEmails", {
48
+ count: maxEmails
49
+ }), function (emails) {
50
+ return (emails === null || emails === void 0 ? void 0 : emails.length) <= maxEmails;
51
+ });
52
+ return yup.object({
53
+ sendTo: validation.min(1, t("neetoMolecules.emailForm.errors.required", {
54
+ entity: t("neetoMolecules.emailForm.fields.sendToEmailAddress")
55
+ })).nullable(),
56
+ sendToCc: validation,
57
+ sendToBcc: validation
58
+ });
59
+ };
84
60
  var SEND_TO_ID_FIELD_VALIDATION = yup.object({
85
61
  sendToId: yup.string().required(t("neetoMolecules.emailForm.errors.required", {
86
62
  entity: t("neetoMolecules.emailForm.labels.sendTo")
@@ -94,7 +70,7 @@ var REPLY_TO_FIELD_VALIDATION = yup.object({
94
70
  var EDITOR_ADDONS = ["highlight", "emoji", "code-block", "block-quote", "image-upload", "divider", "video-embed"];
95
71
 
96
72
  /* eslint-disable @bigbinary/neeto/use-zustand-for-global-state-management */
97
- var EmailFormContext = /*#__PURE__*/React.createContext({
73
+ var EmailFormContext = /*#__PURE__*/React__default.createContext({
98
74
  showSendToField: false,
99
75
  showSendToAsRadio: false,
100
76
  showReplyToField: false
@@ -108,7 +84,7 @@ var ReplyToField = function ReplyToField(_ref) {
108
84
  var _useFormikContext = useFormikContext(),
109
85
  setFieldValue = _useFormikContext.setFieldValue;
110
86
  if (isDropdownField) {
111
- return /*#__PURE__*/React.createElement(Select, {
87
+ return /*#__PURE__*/React__default.createElement(Select, {
112
88
  isClearable: true,
113
89
  className: "w-full",
114
90
  "data-testid": "replyToOptions",
@@ -116,9 +92,7 @@ var ReplyToField = function ReplyToField(_ref) {
116
92
  name: "replyTo",
117
93
  options: replyToOptions,
118
94
  labelProps: {
119
- helpIconProps: _defineProperty(_defineProperty({
120
- icon: Info
121
- }, "data-testid", "reply-to-tooltip"), "tooltipProps", {
95
+ helpIconProps: _defineProperty(_defineProperty({}, "data-testid", "reply-to-tooltip"), "tooltipProps", {
122
96
  content: t("neetoMolecules.emailForm.tooltips.replyTo")
123
97
  })
124
98
  },
@@ -128,7 +102,7 @@ var ReplyToField = function ReplyToField(_ref) {
128
102
  }
129
103
  });
130
104
  }
131
- return /*#__PURE__*/React.createElement(Input, {
105
+ return /*#__PURE__*/React__default.createElement(Input, {
132
106
  autoFocus: true,
133
107
  required: true,
134
108
  className: "w-full",
@@ -138,349 +112,17 @@ var ReplyToField = function ReplyToField(_ref) {
138
112
  placeholder: t("neetoMolecules.emailForm.placeholders.emailPlaceholder"),
139
113
  size: "large",
140
114
  labelProps: {
141
- helpIconProps: _defineProperty(_defineProperty({
142
- icon: Info
143
- }, "data-testid", "reply-to-tooltip"), "tooltipProps", {
115
+ helpIconProps: _defineProperty(_defineProperty({}, "data-testid", "reply-to-tooltip"), "tooltipProps", {
144
116
  content: t("neetoMolecules.emailForm.tooltips.replyTo")
145
117
  })
146
118
  }
147
119
  });
148
120
  };
149
121
 
150
- function _extends() {
151
- _extends = Object.assign ? Object.assign.bind() : function (target) {
152
- for (var i = 1; i < arguments.length; i++) {
153
- var source = arguments[i];
154
- for (var key in source) {
155
- if (Object.prototype.hasOwnProperty.call(source, key)) {
156
- target[key] = source[key];
157
- }
158
- }
159
- }
160
- return target;
161
- };
162
- return _extends.apply(this, arguments);
163
- }
164
-
165
- function _arrayLikeToArray(arr, len) {
166
- if (len == null || len > arr.length) len = arr.length;
167
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
168
- return arr2;
169
- }
170
-
171
- function _arrayWithoutHoles(arr) {
172
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
173
- }
174
-
175
- function _iterableToArray(iter) {
176
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
177
- }
178
-
179
- function _unsupportedIterableToArray(o, minLen) {
180
- if (!o) return;
181
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
182
- var n = Object.prototype.toString.call(o).slice(8, -1);
183
- if (n === "Object" && o.constructor) n = o.constructor.name;
184
- if (n === "Map" || n === "Set") return Array.from(o);
185
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
186
- }
187
-
188
- function _nonIterableSpread() {
189
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
190
- }
191
-
192
- function _toConsumableArray(arr) {
193
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
194
- }
195
-
196
- function _arrayWithHoles(arr) {
197
- if (Array.isArray(arr)) return arr;
198
- }
199
-
200
- function _iterableToArrayLimit(r, l) {
201
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
202
- if (null != t) {
203
- var e,
204
- n,
205
- i,
206
- u,
207
- a = [],
208
- f = !0,
209
- o = !1;
210
- try {
211
- if (i = (t = t.call(r)).next, 0 === l) {
212
- if (Object(t) !== t) return;
213
- f = !1;
214
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
215
- } catch (r) {
216
- o = !0, n = r;
217
- } finally {
218
- try {
219
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
220
- } finally {
221
- if (o) throw n;
222
- }
223
- }
224
- return a;
225
- }
226
- }
227
-
228
- function _nonIterableRest() {
229
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
230
- }
231
-
232
- function _slicedToArray(arr, i) {
233
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
234
- }
235
-
236
- var ALLOWED_FILE_TYPES = [".csv"];
237
- var ONE_MEGABYTE_IN_BYTES = 1024 * 1024;
238
- var DOWNLOAD_SAMPLE_EMAIL_CSV_FILE = "https://d2v7kzglnr2dnh.cloudfront.net/others/sample-bulk-email.csv";
239
-
240
- var Requirements = withT(function (_ref) {
241
- var t = _ref.t,
242
- fileSize = _ref.fileSize;
243
- return /*#__PURE__*/React.createElement(Callout, {
244
- className: "flex flex-col items-center py-6",
245
- style: "info"
246
- }, /*#__PURE__*/React.createElement("ul", {
247
- className: "list-outside list-disc space-y-1 font-normal leading-normal"
248
- }, fileSize && /*#__PURE__*/React.createElement("li", null, t("neetoMolecules.shareViaLink.requirements.fileTypeAndSize", {
249
- limit: fileSize
250
- })), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Trans, {
251
- components: {
252
- strong: /*#__PURE__*/React.createElement("strong", {
253
- className: "font-semibold"
254
- })
255
- },
256
- i18nKey: "neetoMolecules.shareViaLink.requirements.shouldContainColumns"
257
- }))), /*#__PURE__*/React.createElement(Button, {
258
- href: DOWNLOAD_SAMPLE_EMAIL_CSV_FILE,
259
- icon: Download,
260
- iconPosition: "left",
261
- label: t("neetoMolecules.shareViaLink.bulkUploadPane.downloadSampleCSV"),
262
- style: "link"
263
- }));
264
- });
265
- var Requirements$1 = /*#__PURE__*/React.memo(Requirements);
266
-
267
- var BulkUploadPane = function BulkUploadPane(_ref) {
268
- var _fileRejections$;
269
- var isOpen = _ref.isOpen,
270
- fileType = _ref.fileType,
271
- fileSize = _ref.fileSize,
272
- onClose = _ref.onClose,
273
- handleFileSubmit = _ref.handleFileSubmit;
274
- var _useDropzone = useDropzone({
275
- accept: fileType,
276
- maxFiles: 1,
277
- maxSize: fileSize * ONE_MEGABYTE_IN_BYTES,
278
- onDrop: function onDrop(files) {
279
- return files[0] && handleFileSubmit(files[0]);
280
- }
281
- }),
282
- getRootProps = _useDropzone.getRootProps,
283
- getInputProps = _useDropzone.getInputProps,
284
- isDragActive = _useDropzone.isDragActive,
285
- fileRejections = _useDropzone.fileRejections;
286
- var errors = (_fileRejections$ = fileRejections[0]) === null || _fileRejections$ === void 0 ? void 0 : _fileRejections$.errors.map(function (_ref2) {
287
- var message = _ref2.message,
288
- code = _ref2.code;
289
- return /*#__PURE__*/React.createElement(Typography, {
290
- className: "neeto-ui-text-error-500 items",
291
- "data-cy": "file-input-error-message",
292
- key: code,
293
- style: "body3"
294
- }, message);
295
- });
296
- var _useTranslation = useTranslation(),
297
- t = _useTranslation.t;
298
- return /*#__PURE__*/React.createElement(Pane, {
299
- "data-testid": "bulk-upload-pane",
300
- isOpen: isOpen,
301
- onClose: onClose
302
- }, /*#__PURE__*/React.createElement("div", {
303
- tabIndex: 0
304
- }, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
305
- "data-testid": "bulk-upload-header",
306
- style: "h2",
307
- weight: "semibold"
308
- }, t("neetoMolecules.shareViaLink.bulkUpload"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
309
- className: "w-full space-y-4"
310
- }, /*#__PURE__*/React.createElement(Requirements$1, {
311
- fileSize: fileSize
312
- }), /*#__PURE__*/React.createElement("div", getRootProps({
313
- className: classnames("flex flex-col p-2 border neeto-ui-border-primary-500 border-dashed neeto-ui-rounded-md transition duration-500 ease-in-out hover:neeto-ui-bg-gray-100 cursor-pointer items-center", {
314
- "neeto-ui-border-gray-100": isDragActive,
315
- "neeto-ui-border-error neeto-ui-bg-pastel-red hover:neeto-ui-bg-pastel-red": fileRejections.length
316
- })
317
- }), /*#__PURE__*/React.createElement("div", {
318
- className: "flex flex-col items-center space-y-3 p-4"
319
- }, /*#__PURE__*/React.createElement(Upload, {
320
- className: "neeto-ui-text-primary-500",
321
- size: 32
322
- }), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
323
- "data-cy": "csv-upload-input",
324
- "data-testid": "csv-upload-input"
325
- })), isDragActive ? /*#__PURE__*/React.createElement(Typography, {
326
- style: "body2"
327
- }, t("neetoMolecules.shareViaLink.bulkUploadPane.dropFileHere")) : /*#__PURE__*/React.createElement("div", {
328
- className: "flex flex-col items-center space-y-1"
329
- }, /*#__PURE__*/React.createElement("div", {
330
- className: "flex w-full items-center justify-center gap-x-1"
331
- }, /*#__PURE__*/React.createElement(Trans, {
332
- i18nKey: "neetoMolecules.shareViaLink.bulkUploadPane.dragNDrop",
333
- components: {
334
- Button: /*#__PURE__*/React.createElement(Button, {
335
- style: "link"
336
- })
337
- }
338
- })), /*#__PURE__*/React.createElement(Typography, {
339
- className: "neeto-ui-text-gray-700",
340
- style: "body3"
341
- }, fileType && /*#__PURE__*/React.createElement(Trans, {
342
- i18nKey: "neetoMolecules.shareViaLink.bulkUploadPane.supportedFormat",
343
- values: {
344
- fileType: fileType
345
- },
346
- components: {
347
- code: /*#__PURE__*/React.createElement("code", {
348
- className: "neeto-ui-typography neeto-ui-text-body3 neeto-ui-bg-white m-0 border-l-0 p-0"
349
- })
350
- }
351
- }), " ", fileSize && t("neetoMolecules.shareViaLink.bulkUploadPane.supportedSize", {
352
- fileSize: fileSize
353
- })))), errors))), /*#__PURE__*/React.createElement(Pane.Footer, {
354
- className: "flex items-center space-x-2"
355
- }, /*#__PURE__*/React.createElement(Button, {
356
- "data-cy": "bulk-upload-cancel-button",
357
- "data-testid": "bulk-upload-cancel-button",
358
- label: t("neetoMolecules.common.actions.cancel"),
359
- style: "text",
360
- type: "reset",
361
- onClick: onClose
362
- }))));
363
- };
364
-
365
- var isValidEmail = function isValidEmail(email) {
366
- return string().email().isValidSync(email);
367
- };
368
- var createEmailOptions = function createEmailOptions() {
369
- var emails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
370
- return emails.map(function (email) {
371
- return {
372
- label: email,
373
- value: email,
374
- valid: isValidEmail(email)
375
- };
376
- });
377
- };
378
- var parseCsvEmails = function parseCsvEmails(file, onSuccess) {
379
- Papa.parse(file, {
380
- header: true,
381
- skipEmptyLines: true,
382
- transformHeader: function transformHeader(h) {
383
- return h.toLowerCase().replace(/\W/g, "");
384
- },
385
- complete: function complete(results) {
386
- var _results$meta$fields;
387
- var isEmailFieldPresent = (_results$meta$fields = results.meta.fields) === null || _results$meta$fields === void 0 ? void 0 : _results$meta$fields.includes("email");
388
- if (isEmailFieldPresent) {
389
- var emails = results.data.filter(prop("email")).map(function (item) {
390
- return item.email.trim();
391
- });
392
- onSuccess(createEmailOptions(emails));
393
- } else {
394
- Toastr.error(t("neetoMolecules.sendToFields.errors.invalidCsv"));
395
- }
396
- }
397
- });
398
- };
399
-
400
- var SendToFields = function SendToFields(_ref) {
401
- var emailInputProps = _ref.emailInputProps,
402
- ccInputProps = _ref.ccInputProps,
403
- bccInputProps = _ref.bccInputProps,
404
- _ref$showUploadCsvBut = _ref.showUploadCsvButton,
405
- showUploadCsvButton = _ref$showUploadCsvBut === void 0 ? false : _ref$showUploadCsvBut,
406
- _ref$showCcBccButton = _ref.showCcBccButton,
407
- showCcBccButton = _ref$showCcBccButton === void 0 ? false : _ref$showCcBccButton;
408
- var _useState = useState(false),
409
- _useState2 = _slicedToArray(_useState, 2),
410
- isBulkUploadPaneOpen = _useState2[0],
411
- setIsBulkUploadPaneOpen = _useState2[1];
412
- var sendToFieldRef = useRef();
413
- var _useFormikContext = useFormikContext(),
414
- _useFormikContext$val = _useFormikContext.values,
415
- showCopyEmails = _useFormikContext$val.showCopyEmails,
416
- existingSendToEmails = _useFormikContext$val[emailInputProps.name || "sendTo"],
417
- setFieldValue = _useFormikContext.setFieldValue;
418
- var _useTranslation = useTranslation(),
419
- t = _useTranslation.t;
420
- var handleCSVFile = function handleCSVFile(file) {
421
- try {
422
- var _sendToFieldRef$curre;
423
- var onSuccess = function onSuccess(values) {
424
- return setFieldValue(emailInputProps.name || "sendTo", [].concat(_toConsumableArray(existingSendToEmails), _toConsumableArray(values)));
425
- };
426
- parseCsvEmails(file, onSuccess);
427
- setIsBulkUploadPaneOpen(false);
428
- (_sendToFieldRef$curre = sendToFieldRef.current) === null || _sendToFieldRef$curre === void 0 ? void 0 : _sendToFieldRef$curre.focus();
429
- } catch (error) {
430
- Toastr.error(error);
431
- }
432
- };
433
- var handelCcBccButtonClick = function handelCcBccButtonClick(e) {
434
- e.stopPropagation();
435
- setFieldValue("showCopyEmails", !showCopyEmails);
436
- };
437
- return /*#__PURE__*/React.createElement("div", {
438
- className: "relative w-full flex-col gap-2"
439
- }, showUploadCsvButton && /*#__PURE__*/React.createElement(Button, {
440
- className: "absolute top-0 right-1",
441
- "data-testid": "bulk-upload-button",
442
- icon: Upload,
443
- label: t("neetoMolecules.shareViaLink.bulkUpload"),
444
- size: "small",
445
- style: "link",
446
- onClick: function onClick() {
447
- return setIsBulkUploadPaneOpen(true);
448
- }
449
- }), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
450
- "data-testid": "emails",
451
- name: "sendTo",
452
- ref: sendToFieldRef
453
- }, emailInputProps, {
454
- suffix: showCcBccButton && /*#__PURE__*/React.createElement(Button, {
455
- "data-cy": "cc-bcc-button",
456
- "data-testid": "cc-bcc-button",
457
- label: t("neetoMolecules.emailForm.labels.ccBcc"),
458
- size: "small",
459
- style: "link",
460
- onClick: handelCcBccButtonClick
461
- })
462
- })), showCopyEmails && /*#__PURE__*/React.createElement("div", {
463
- className: "mt-5 flex w-full flex-col gap-6"
464
- }, /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
465
- name: "sendToBcc"
466
- }, ccInputProps)), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
467
- name: "sendToCc"
468
- }, bccInputProps))), /*#__PURE__*/React.createElement(BulkUploadPane, {
469
- fileSize: globalProps.endUserUploadedFileSizeLimitInMb,
470
- fileType: ALLOWED_FILE_TYPES,
471
- handleFileSubmit: handleCSVFile,
472
- isOpen: isBulkUploadPaneOpen,
473
- onClose: function onClose() {
474
- return setIsBulkUploadPaneOpen(false);
475
- }
476
- }));
477
- };
478
-
479
122
  var SendToField = withT(function (_ref) {
480
123
  var t = _ref.t;
481
- return /*#__PURE__*/React.createElement(SendToFields, {
124
+ return /*#__PURE__*/React__default.createElement(SendToFields, {
482
125
  showCcBccButton: true,
483
- showUploadCsvButton: true,
484
126
  bccInputProps: {
485
127
  label: t("neetoMolecules.emailForm.labels.bCc"),
486
128
  name: "sendToBcc",
@@ -523,14 +165,14 @@ var SubjectField = function SubjectField(_ref) {
523
165
  var updatedSubject = [text.slice(0, splitIndex), " {{".concat(slug, "}}"), text.slice(splitIndex)].join("");
524
166
  updateText(updatedSubject);
525
167
  };
526
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input$1, {
168
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Input$1, {
527
169
  error: error,
528
170
  name: name,
529
171
  required: required,
530
172
  label: t("neetoMolecules.emailForm.labels.subject"),
531
173
  size: "large",
532
174
  value: text,
533
- suffix: /*#__PURE__*/React.createElement(DynamicVariables, {
175
+ suffix: /*#__PURE__*/React__default.createElement(DynamicVariables, {
534
176
  variables: subjectVariables,
535
177
  dropdownProps: {
536
178
  className: "neeto-ui-dropdown__popup overflow-y-auto",
@@ -542,13 +184,13 @@ var SubjectField = function SubjectField(_ref) {
542
184
  onFocus: function onFocus() {
543
185
  return setIsFieldFocusedOnce(true);
544
186
  }
545
- }), /*#__PURE__*/React.createElement(Typography, {
187
+ }), /*#__PURE__*/React__default.createElement(Typography, {
546
188
  className: "neeto-ui-text-gray-600 mt-2",
547
189
  "data-cy": "subject-input-variable-label",
548
190
  style: "body3"
549
- }, /*#__PURE__*/React.createElement(Trans, {
191
+ }, /*#__PURE__*/React__default.createElement(Trans, {
550
192
  components: {
551
- span: /*#__PURE__*/React.createElement("span", {
193
+ span: /*#__PURE__*/React__default.createElement("span", {
552
194
  className: "font-semibold"
553
195
  })
554
196
  },
@@ -583,32 +225,32 @@ var EmailForm = function EmailForm(_ref) {
583
225
  showSendToAsRadio = _useContext.showSendToAsRadio,
584
226
  showReplyToField = _useContext.showReplyToField;
585
227
  var _useFormikContext = useFormikContext(),
586
- setFieldValue = _useFormikContext.setFieldValue,
587
- dirty = _useFormikContext.dirty;
228
+ setFieldValue = _useFormikContext.setFieldValue;
588
229
  var showSendToRadioField = showSendToField && showSendToAsRadio && isNotEmpty(sendToOptions);
589
- return /*#__PURE__*/React.createElement("div", {
230
+ var showSendToTextField = showSendToField && !showSendToRadioField;
231
+ return /*#__PURE__*/React__default.createElement("div", {
590
232
  "data-testid": "email-form",
591
233
  className: classnames("flex flex-1 flex-col items-start gap-2", _defineProperty({}, className, className))
592
- }, showFields && /*#__PURE__*/React.createElement("div", {
234
+ }, showFields && /*#__PURE__*/React__default.createElement("div", {
593
235
  className: "flex w-full flex-col items-start justify-start gap-6"
594
- }, /*#__PURE__*/React.createElement(Field, {
236
+ }, /*#__PURE__*/React__default.createElement(Field, {
595
237
  name: "subject"
596
238
  }, function (_ref2) {
597
239
  var value = _ref2.field.value,
598
240
  error = _ref2.meta.error;
599
- return /*#__PURE__*/React.createElement("div", {
241
+ return /*#__PURE__*/React__default.createElement("div", {
600
242
  className: "w-full"
601
- }, /*#__PURE__*/React.createElement(SubjectField, {
602
- error: t(error),
603
- name: "subject",
243
+ }, /*#__PURE__*/React__default.createElement(SubjectField, {
604
244
  subjectVariables: subjectVariables,
605
245
  required: true,
246
+ error: t(error),
247
+ name: "subject",
606
248
  text: value,
607
249
  updateText: function updateText(text) {
608
250
  return setFieldValue("subject", text);
609
251
  }
610
252
  }));
611
- }), showSendToRadioField ? /*#__PURE__*/React.createElement(Radio, {
253
+ }), showSendToRadioField && /*#__PURE__*/React__default.createElement(Radio, {
612
254
  "data-testid": "send-to-id",
613
255
  label: t("neetoMolecules.emailForm.labels.sendTo"),
614
256
  labelProps: {
@@ -618,16 +260,16 @@ var EmailForm = function EmailForm(_ref) {
618
260
  }, sendToOptions.map(function (_ref3) {
619
261
  var label = _ref3.label,
620
262
  value = _ref3.value;
621
- return /*#__PURE__*/React.createElement(Radio.Item, {
263
+ return /*#__PURE__*/React__default.createElement(Radio.Item, {
622
264
  label: label,
623
265
  value: value,
624
266
  key: value
625
267
  });
626
- })) : /*#__PURE__*/React.createElement(SendToField, null), showReplyToField && /*#__PURE__*/React.createElement(ReplyToField, {
268
+ })), showSendToTextField && /*#__PURE__*/React__default.createElement(SendToField, null), showReplyToField && /*#__PURE__*/React__default.createElement(ReplyToField, {
627
269
  replyToOptions: replyToOptions
628
- }), /*#__PURE__*/React.createElement("div", {
270
+ }), /*#__PURE__*/React__default.createElement("div", {
629
271
  className: "w-full"
630
- }, /*#__PURE__*/React.createElement(FormikEditor, {
272
+ }, /*#__PURE__*/React__default.createElement(FormikEditor, {
631
273
  isMenuCollapsible: true,
632
274
  required: true,
633
275
  addons: EDITOR_ADDONS,
@@ -636,31 +278,26 @@ var EmailForm = function EmailForm(_ref) {
636
278
  label: t("neetoMolecules.emailForm.labels.message"),
637
279
  name: "message",
638
280
  variables: messageVariables
639
- }), /*#__PURE__*/React.createElement(Typography, {
281
+ }), /*#__PURE__*/React__default.createElement(Typography, {
640
282
  className: "neeto-ui-text-gray-500 mt-2",
641
283
  "data-cy": "message-input-variable-label",
642
284
  style: "body3"
643
- }, /*#__PURE__*/React.createElement(Trans, {
285
+ }, /*#__PURE__*/React__default.createElement(Trans, {
644
286
  i18nKey: "neetoMolecules.emailForm.helpText",
645
287
  values: {
646
288
  type: "message"
647
289
  },
648
290
  components: {
649
- span: /*#__PURE__*/React.createElement("span", {
291
+ span: /*#__PURE__*/React__default.createElement("span", {
650
292
  className: "font-semibold"
651
293
  })
652
294
  }
653
- })))), /*#__PURE__*/React.createElement(ActionBlock, {
654
- className: "mt-6 w-full justify-start",
295
+ })))), /*#__PURE__*/React__default.createElement(ActionBlock, {
655
296
  cancelButtonProps: {
656
- disabled: false,
657
- onClick: handleCancel,
658
- className: "ml-3"
297
+ onClick: handleCancel
659
298
  },
660
- submitButtonProps: {
661
- loading: isLoading,
662
- disabled: !dirty || isUpdating
663
- }
299
+ className: "mt-6 w-full justify-start",
300
+ isSubmitting: isLoading || isUpdating
664
301
  }));
665
302
  };
666
303
 
@@ -668,10 +305,11 @@ var getValidationSchema = function getValidationSchema(_ref) {
668
305
  var showSendToField = _ref.showSendToField,
669
306
  showReplyToField = _ref.showReplyToField,
670
307
  showSendToAsRadio = _ref.showSendToAsRadio,
671
- customValidations = _ref.customValidations;
308
+ customValidations = _ref.customValidations,
309
+ maxEmails = _ref.maxEmails;
672
310
  var schema = EMAIL_FORM_VALIDATION_SCHEMA.clone();
673
311
  if (showSendToField) {
674
- schema = schema.concat(showSendToAsRadio ? SEND_TO_ID_FIELD_VALIDATION : SEND_TO_FIELD_VALIDATION);
312
+ schema = schema.concat(showSendToAsRadio ? SEND_TO_ID_FIELD_VALIDATION : sendToFieldValidation(maxEmails));
675
313
  }
676
314
  if (showReplyToField) schema = schema.concat(REPLY_TO_FIELD_VALIDATION);
677
315
  return schema.shape(customValidations);
@@ -693,23 +331,26 @@ var EmailFormProvider = function EmailFormProvider(_ref) {
693
331
  _ref$showReplyToField = _ref.showReplyToField,
694
332
  showReplyToField = _ref$showReplyToField === void 0 ? false : _ref$showReplyToField,
695
333
  _ref$showSendToAsRadi = _ref.showSendToAsRadio,
696
- showSendToAsRadio = _ref$showSendToAsRadi === void 0 ? false : _ref$showSendToAsRadi;
697
- return /*#__PURE__*/React.createElement("div", {
334
+ showSendToAsRadio = _ref$showSendToAsRadi === void 0 ? false : _ref$showSendToAsRadi,
335
+ _ref$maxEmails = _ref.maxEmails,
336
+ maxEmails = _ref$maxEmails === void 0 ? 10 : _ref$maxEmails;
337
+ return /*#__PURE__*/React__default.createElement("div", {
698
338
  "data-testid": "email-form-provider"
699
- }, /*#__PURE__*/React.createElement(EmailFormContext.Provider, {
339
+ }, /*#__PURE__*/React__default.createElement(EmailFormContext.Provider, {
700
340
  value: {
701
341
  showSendToField: showSendToField,
702
342
  showSendToAsRadio: showSendToAsRadio,
703
343
  showReplyToField: showReplyToField
704
344
  }
705
- }, /*#__PURE__*/React.createElement(Form, {
345
+ }, /*#__PURE__*/React__default.createElement(Form, {
706
346
  formikProps: _objectSpread({
707
347
  enableReinitialize: true,
708
348
  validationSchema: getValidationSchema({
709
349
  showSendToField: showSendToField,
710
350
  showReplyToField: showReplyToField,
711
351
  showSendToAsRadio: showSendToAsRadio,
712
- customValidations: customValidations
352
+ customValidations: customValidations,
353
+ maxEmails: maxEmails
713
354
  }),
714
355
  initialValues: _objectSpread(_objectSpread({}, initialValues), {}, {
715
356
  replyTo: initialValues.replyTo || globalProps.user.email
@@ -719,1308 +360,5 @@ var EmailFormProvider = function EmailFormProvider(_ref) {
719
360
  }, children)));
720
361
  };
721
362
 
722
- var propTypes = {exports: {}};
723
-
724
- var reactIs = {exports: {}};
725
-
726
- var reactIs_production_min = {};
727
-
728
- /** @license React v16.13.1
729
- * react-is.production.min.js
730
- *
731
- * Copyright (c) Facebook, Inc. and its affiliates.
732
- *
733
- * This source code is licensed under the MIT license found in the
734
- * LICENSE file in the root directory of this source tree.
735
- */
736
-
737
- var hasRequiredReactIs_production_min;
738
-
739
- function requireReactIs_production_min () {
740
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
741
- hasRequiredReactIs_production_min = 1;
742
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
743
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
744
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
745
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
746
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
747
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
748
- return reactIs_production_min;
749
- }
750
-
751
- var reactIs_development = {};
752
-
753
- /** @license React v16.13.1
754
- * react-is.development.js
755
- *
756
- * Copyright (c) Facebook, Inc. and its affiliates.
757
- *
758
- * This source code is licensed under the MIT license found in the
759
- * LICENSE file in the root directory of this source tree.
760
- */
761
-
762
- var hasRequiredReactIs_development;
763
-
764
- function requireReactIs_development () {
765
- if (hasRequiredReactIs_development) return reactIs_development;
766
- hasRequiredReactIs_development = 1;
767
-
768
-
769
-
770
- if (process.env.NODE_ENV !== "production") {
771
- (function() {
772
-
773
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
774
- // nor polyfill, then a plain number is used for performance.
775
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
776
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
777
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
778
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
779
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
780
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
781
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
782
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
783
- // (unstable) APIs that have been removed. Can we remove the symbols?
784
-
785
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
786
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
787
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
788
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
789
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
790
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
791
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
792
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
793
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
794
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
795
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
796
-
797
- function isValidElementType(type) {
798
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
799
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
800
- }
801
-
802
- function typeOf(object) {
803
- if (typeof object === 'object' && object !== null) {
804
- var $$typeof = object.$$typeof;
805
-
806
- switch ($$typeof) {
807
- case REACT_ELEMENT_TYPE:
808
- var type = object.type;
809
-
810
- switch (type) {
811
- case REACT_ASYNC_MODE_TYPE:
812
- case REACT_CONCURRENT_MODE_TYPE:
813
- case REACT_FRAGMENT_TYPE:
814
- case REACT_PROFILER_TYPE:
815
- case REACT_STRICT_MODE_TYPE:
816
- case REACT_SUSPENSE_TYPE:
817
- return type;
818
-
819
- default:
820
- var $$typeofType = type && type.$$typeof;
821
-
822
- switch ($$typeofType) {
823
- case REACT_CONTEXT_TYPE:
824
- case REACT_FORWARD_REF_TYPE:
825
- case REACT_LAZY_TYPE:
826
- case REACT_MEMO_TYPE:
827
- case REACT_PROVIDER_TYPE:
828
- return $$typeofType;
829
-
830
- default:
831
- return $$typeof;
832
- }
833
-
834
- }
835
-
836
- case REACT_PORTAL_TYPE:
837
- return $$typeof;
838
- }
839
- }
840
-
841
- return undefined;
842
- } // AsyncMode is deprecated along with isAsyncMode
843
-
844
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
845
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
846
- var ContextConsumer = REACT_CONTEXT_TYPE;
847
- var ContextProvider = REACT_PROVIDER_TYPE;
848
- var Element = REACT_ELEMENT_TYPE;
849
- var ForwardRef = REACT_FORWARD_REF_TYPE;
850
- var Fragment = REACT_FRAGMENT_TYPE;
851
- var Lazy = REACT_LAZY_TYPE;
852
- var Memo = REACT_MEMO_TYPE;
853
- var Portal = REACT_PORTAL_TYPE;
854
- var Profiler = REACT_PROFILER_TYPE;
855
- var StrictMode = REACT_STRICT_MODE_TYPE;
856
- var Suspense = REACT_SUSPENSE_TYPE;
857
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
858
-
859
- function isAsyncMode(object) {
860
- {
861
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
862
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
863
-
864
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
865
- }
866
- }
867
-
868
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
869
- }
870
- function isConcurrentMode(object) {
871
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
872
- }
873
- function isContextConsumer(object) {
874
- return typeOf(object) === REACT_CONTEXT_TYPE;
875
- }
876
- function isContextProvider(object) {
877
- return typeOf(object) === REACT_PROVIDER_TYPE;
878
- }
879
- function isElement(object) {
880
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
881
- }
882
- function isForwardRef(object) {
883
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
884
- }
885
- function isFragment(object) {
886
- return typeOf(object) === REACT_FRAGMENT_TYPE;
887
- }
888
- function isLazy(object) {
889
- return typeOf(object) === REACT_LAZY_TYPE;
890
- }
891
- function isMemo(object) {
892
- return typeOf(object) === REACT_MEMO_TYPE;
893
- }
894
- function isPortal(object) {
895
- return typeOf(object) === REACT_PORTAL_TYPE;
896
- }
897
- function isProfiler(object) {
898
- return typeOf(object) === REACT_PROFILER_TYPE;
899
- }
900
- function isStrictMode(object) {
901
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
902
- }
903
- function isSuspense(object) {
904
- return typeOf(object) === REACT_SUSPENSE_TYPE;
905
- }
906
-
907
- reactIs_development.AsyncMode = AsyncMode;
908
- reactIs_development.ConcurrentMode = ConcurrentMode;
909
- reactIs_development.ContextConsumer = ContextConsumer;
910
- reactIs_development.ContextProvider = ContextProvider;
911
- reactIs_development.Element = Element;
912
- reactIs_development.ForwardRef = ForwardRef;
913
- reactIs_development.Fragment = Fragment;
914
- reactIs_development.Lazy = Lazy;
915
- reactIs_development.Memo = Memo;
916
- reactIs_development.Portal = Portal;
917
- reactIs_development.Profiler = Profiler;
918
- reactIs_development.StrictMode = StrictMode;
919
- reactIs_development.Suspense = Suspense;
920
- reactIs_development.isAsyncMode = isAsyncMode;
921
- reactIs_development.isConcurrentMode = isConcurrentMode;
922
- reactIs_development.isContextConsumer = isContextConsumer;
923
- reactIs_development.isContextProvider = isContextProvider;
924
- reactIs_development.isElement = isElement;
925
- reactIs_development.isForwardRef = isForwardRef;
926
- reactIs_development.isFragment = isFragment;
927
- reactIs_development.isLazy = isLazy;
928
- reactIs_development.isMemo = isMemo;
929
- reactIs_development.isPortal = isPortal;
930
- reactIs_development.isProfiler = isProfiler;
931
- reactIs_development.isStrictMode = isStrictMode;
932
- reactIs_development.isSuspense = isSuspense;
933
- reactIs_development.isValidElementType = isValidElementType;
934
- reactIs_development.typeOf = typeOf;
935
- })();
936
- }
937
- return reactIs_development;
938
- }
939
-
940
- var hasRequiredReactIs;
941
-
942
- function requireReactIs () {
943
- if (hasRequiredReactIs) return reactIs.exports;
944
- hasRequiredReactIs = 1;
945
- (function (module) {
946
-
947
- if (process.env.NODE_ENV === 'production') {
948
- module.exports = requireReactIs_production_min();
949
- } else {
950
- module.exports = requireReactIs_development();
951
- }
952
- } (reactIs));
953
- return reactIs.exports;
954
- }
955
-
956
- /*
957
- object-assign
958
- (c) Sindre Sorhus
959
- @license MIT
960
- */
961
-
962
- var objectAssign;
963
- var hasRequiredObjectAssign;
964
-
965
- function requireObjectAssign () {
966
- if (hasRequiredObjectAssign) return objectAssign;
967
- hasRequiredObjectAssign = 1;
968
- /* eslint-disable no-unused-vars */
969
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
970
- var hasOwnProperty = Object.prototype.hasOwnProperty;
971
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
972
-
973
- function toObject(val) {
974
- if (val === null || val === undefined) {
975
- throw new TypeError('Object.assign cannot be called with null or undefined');
976
- }
977
-
978
- return Object(val);
979
- }
980
-
981
- function shouldUseNative() {
982
- try {
983
- if (!Object.assign) {
984
- return false;
985
- }
986
-
987
- // Detect buggy property enumeration order in older V8 versions.
988
-
989
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
990
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
991
- test1[5] = 'de';
992
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
993
- return false;
994
- }
995
-
996
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
997
- var test2 = {};
998
- for (var i = 0; i < 10; i++) {
999
- test2['_' + String.fromCharCode(i)] = i;
1000
- }
1001
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1002
- return test2[n];
1003
- });
1004
- if (order2.join('') !== '0123456789') {
1005
- return false;
1006
- }
1007
-
1008
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1009
- var test3 = {};
1010
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1011
- test3[letter] = letter;
1012
- });
1013
- if (Object.keys(Object.assign({}, test3)).join('') !==
1014
- 'abcdefghijklmnopqrst') {
1015
- return false;
1016
- }
1017
-
1018
- return true;
1019
- } catch (err) {
1020
- // We don't expect any of the above to throw, but better to be safe.
1021
- return false;
1022
- }
1023
- }
1024
-
1025
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
1026
- var from;
1027
- var to = toObject(target);
1028
- var symbols;
1029
-
1030
- for (var s = 1; s < arguments.length; s++) {
1031
- from = Object(arguments[s]);
1032
-
1033
- for (var key in from) {
1034
- if (hasOwnProperty.call(from, key)) {
1035
- to[key] = from[key];
1036
- }
1037
- }
1038
-
1039
- if (getOwnPropertySymbols) {
1040
- symbols = getOwnPropertySymbols(from);
1041
- for (var i = 0; i < symbols.length; i++) {
1042
- if (propIsEnumerable.call(from, symbols[i])) {
1043
- to[symbols[i]] = from[symbols[i]];
1044
- }
1045
- }
1046
- }
1047
- }
1048
-
1049
- return to;
1050
- };
1051
- return objectAssign;
1052
- }
1053
-
1054
- /**
1055
- * Copyright (c) 2013-present, Facebook, Inc.
1056
- *
1057
- * This source code is licensed under the MIT license found in the
1058
- * LICENSE file in the root directory of this source tree.
1059
- */
1060
-
1061
- var ReactPropTypesSecret_1;
1062
- var hasRequiredReactPropTypesSecret;
1063
-
1064
- function requireReactPropTypesSecret () {
1065
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
1066
- hasRequiredReactPropTypesSecret = 1;
1067
-
1068
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1069
-
1070
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
1071
- return ReactPropTypesSecret_1;
1072
- }
1073
-
1074
- var has;
1075
- var hasRequiredHas;
1076
-
1077
- function requireHas () {
1078
- if (hasRequiredHas) return has;
1079
- hasRequiredHas = 1;
1080
- has = Function.call.bind(Object.prototype.hasOwnProperty);
1081
- return has;
1082
- }
1083
-
1084
- /**
1085
- * Copyright (c) 2013-present, Facebook, Inc.
1086
- *
1087
- * This source code is licensed under the MIT license found in the
1088
- * LICENSE file in the root directory of this source tree.
1089
- */
1090
-
1091
- var checkPropTypes_1;
1092
- var hasRequiredCheckPropTypes;
1093
-
1094
- function requireCheckPropTypes () {
1095
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
1096
- hasRequiredCheckPropTypes = 1;
1097
-
1098
- var printWarning = function() {};
1099
-
1100
- if (process.env.NODE_ENV !== 'production') {
1101
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1102
- var loggedTypeFailures = {};
1103
- var has = requireHas();
1104
-
1105
- printWarning = function(text) {
1106
- var message = 'Warning: ' + text;
1107
- if (typeof console !== 'undefined') {
1108
- console.error(message);
1109
- }
1110
- try {
1111
- // --- Welcome to debugging React ---
1112
- // This error was thrown as a convenience so that you can use this stack
1113
- // to find the callsite that caused this warning to fire.
1114
- throw new Error(message);
1115
- } catch (x) { /**/ }
1116
- };
1117
- }
1118
-
1119
- /**
1120
- * Assert that the values match with the type specs.
1121
- * Error messages are memorized and will only be shown once.
1122
- *
1123
- * @param {object} typeSpecs Map of name to a ReactPropType
1124
- * @param {object} values Runtime values that need to be type-checked
1125
- * @param {string} location e.g. "prop", "context", "child context"
1126
- * @param {string} componentName Name of the component for error messages.
1127
- * @param {?Function} getStack Returns the component stack.
1128
- * @private
1129
- */
1130
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1131
- if (process.env.NODE_ENV !== 'production') {
1132
- for (var typeSpecName in typeSpecs) {
1133
- if (has(typeSpecs, typeSpecName)) {
1134
- var error;
1135
- // Prop type validation may throw. In case they do, we don't want to
1136
- // fail the render phase where it didn't fail before. So we log it.
1137
- // After these have been cleaned up, we'll let them throw.
1138
- try {
1139
- // This is intentionally an invariant that gets caught. It's the same
1140
- // behavior as without this statement except with a better message.
1141
- if (typeof typeSpecs[typeSpecName] !== 'function') {
1142
- var err = Error(
1143
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
1144
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
1145
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
1146
- );
1147
- err.name = 'Invariant Violation';
1148
- throw err;
1149
- }
1150
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1151
- } catch (ex) {
1152
- error = ex;
1153
- }
1154
- if (error && !(error instanceof Error)) {
1155
- printWarning(
1156
- (componentName || 'React class') + ': type specification of ' +
1157
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
1158
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
1159
- 'You may have forgotten to pass an argument to the type checker ' +
1160
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
1161
- 'shape all require an argument).'
1162
- );
1163
- }
1164
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1165
- // Only monitor this failure once because there tends to be a lot of the
1166
- // same error.
1167
- loggedTypeFailures[error.message] = true;
1168
-
1169
- var stack = getStack ? getStack() : '';
1170
-
1171
- printWarning(
1172
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
1173
- );
1174
- }
1175
- }
1176
- }
1177
- }
1178
- }
1179
-
1180
- /**
1181
- * Resets warning cache when testing.
1182
- *
1183
- * @private
1184
- */
1185
- checkPropTypes.resetWarningCache = function() {
1186
- if (process.env.NODE_ENV !== 'production') {
1187
- loggedTypeFailures = {};
1188
- }
1189
- };
1190
-
1191
- checkPropTypes_1 = checkPropTypes;
1192
- return checkPropTypes_1;
1193
- }
1194
-
1195
- /**
1196
- * Copyright (c) 2013-present, Facebook, Inc.
1197
- *
1198
- * This source code is licensed under the MIT license found in the
1199
- * LICENSE file in the root directory of this source tree.
1200
- */
1201
-
1202
- var factoryWithTypeCheckers;
1203
- var hasRequiredFactoryWithTypeCheckers;
1204
-
1205
- function requireFactoryWithTypeCheckers () {
1206
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
1207
- hasRequiredFactoryWithTypeCheckers = 1;
1208
-
1209
- var ReactIs = requireReactIs();
1210
- var assign = requireObjectAssign();
1211
-
1212
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1213
- var has = requireHas();
1214
- var checkPropTypes = requireCheckPropTypes();
1215
-
1216
- var printWarning = function() {};
1217
-
1218
- if (process.env.NODE_ENV !== 'production') {
1219
- printWarning = function(text) {
1220
- var message = 'Warning: ' + text;
1221
- if (typeof console !== 'undefined') {
1222
- console.error(message);
1223
- }
1224
- try {
1225
- // --- Welcome to debugging React ---
1226
- // This error was thrown as a convenience so that you can use this stack
1227
- // to find the callsite that caused this warning to fire.
1228
- throw new Error(message);
1229
- } catch (x) {}
1230
- };
1231
- }
1232
-
1233
- function emptyFunctionThatReturnsNull() {
1234
- return null;
1235
- }
1236
-
1237
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1238
- /* global Symbol */
1239
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1240
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
1241
-
1242
- /**
1243
- * Returns the iterator method function contained on the iterable object.
1244
- *
1245
- * Be sure to invoke the function with the iterable as context:
1246
- *
1247
- * var iteratorFn = getIteratorFn(myIterable);
1248
- * if (iteratorFn) {
1249
- * var iterator = iteratorFn.call(myIterable);
1250
- * ...
1251
- * }
1252
- *
1253
- * @param {?object} maybeIterable
1254
- * @return {?function}
1255
- */
1256
- function getIteratorFn(maybeIterable) {
1257
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
1258
- if (typeof iteratorFn === 'function') {
1259
- return iteratorFn;
1260
- }
1261
- }
1262
-
1263
- /**
1264
- * Collection of methods that allow declaration and validation of props that are
1265
- * supplied to React components. Example usage:
1266
- *
1267
- * var Props = require('ReactPropTypes');
1268
- * var MyArticle = React.createClass({
1269
- * propTypes: {
1270
- * // An optional string prop named "description".
1271
- * description: Props.string,
1272
- *
1273
- * // A required enum prop named "category".
1274
- * category: Props.oneOf(['News','Photos']).isRequired,
1275
- *
1276
- * // A prop named "dialog" that requires an instance of Dialog.
1277
- * dialog: Props.instanceOf(Dialog).isRequired
1278
- * },
1279
- * render: function() { ... }
1280
- * });
1281
- *
1282
- * A more formal specification of how these methods are used:
1283
- *
1284
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
1285
- * decl := ReactPropTypes.{type}(.isRequired)?
1286
- *
1287
- * Each and every declaration produces a function with the same signature. This
1288
- * allows the creation of custom validation functions. For example:
1289
- *
1290
- * var MyLink = React.createClass({
1291
- * propTypes: {
1292
- * // An optional string or URI prop named "href".
1293
- * href: function(props, propName, componentName) {
1294
- * var propValue = props[propName];
1295
- * if (propValue != null && typeof propValue !== 'string' &&
1296
- * !(propValue instanceof URI)) {
1297
- * return new Error(
1298
- * 'Expected a string or an URI for ' + propName + ' in ' +
1299
- * componentName
1300
- * );
1301
- * }
1302
- * }
1303
- * },
1304
- * render: function() {...}
1305
- * });
1306
- *
1307
- * @internal
1308
- */
1309
-
1310
- var ANONYMOUS = '<<anonymous>>';
1311
-
1312
- // Important!
1313
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1314
- var ReactPropTypes = {
1315
- array: createPrimitiveTypeChecker('array'),
1316
- bigint: createPrimitiveTypeChecker('bigint'),
1317
- bool: createPrimitiveTypeChecker('boolean'),
1318
- func: createPrimitiveTypeChecker('function'),
1319
- number: createPrimitiveTypeChecker('number'),
1320
- object: createPrimitiveTypeChecker('object'),
1321
- string: createPrimitiveTypeChecker('string'),
1322
- symbol: createPrimitiveTypeChecker('symbol'),
1323
-
1324
- any: createAnyTypeChecker(),
1325
- arrayOf: createArrayOfTypeChecker,
1326
- element: createElementTypeChecker(),
1327
- elementType: createElementTypeTypeChecker(),
1328
- instanceOf: createInstanceTypeChecker,
1329
- node: createNodeChecker(),
1330
- objectOf: createObjectOfTypeChecker,
1331
- oneOf: createEnumTypeChecker,
1332
- oneOfType: createUnionTypeChecker,
1333
- shape: createShapeTypeChecker,
1334
- exact: createStrictShapeTypeChecker,
1335
- };
1336
-
1337
- /**
1338
- * inlined Object.is polyfill to avoid requiring consumers ship their own
1339
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1340
- */
1341
- /*eslint-disable no-self-compare*/
1342
- function is(x, y) {
1343
- // SameValue algorithm
1344
- if (x === y) {
1345
- // Steps 1-5, 7-10
1346
- // Steps 6.b-6.e: +0 != -0
1347
- return x !== 0 || 1 / x === 1 / y;
1348
- } else {
1349
- // Step 6.a: NaN == NaN
1350
- return x !== x && y !== y;
1351
- }
1352
- }
1353
- /*eslint-enable no-self-compare*/
1354
-
1355
- /**
1356
- * We use an Error-like object for backward compatibility as people may call
1357
- * PropTypes directly and inspect their output. However, we don't use real
1358
- * Errors anymore. We don't inspect their stack anyway, and creating them
1359
- * is prohibitively expensive if they are created too often, such as what
1360
- * happens in oneOfType() for any type before the one that matched.
1361
- */
1362
- function PropTypeError(message, data) {
1363
- this.message = message;
1364
- this.data = data && typeof data === 'object' ? data: {};
1365
- this.stack = '';
1366
- }
1367
- // Make `instanceof Error` still work for returned errors.
1368
- PropTypeError.prototype = Error.prototype;
1369
-
1370
- function createChainableTypeChecker(validate) {
1371
- if (process.env.NODE_ENV !== 'production') {
1372
- var manualPropTypeCallCache = {};
1373
- var manualPropTypeWarningCount = 0;
1374
- }
1375
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1376
- componentName = componentName || ANONYMOUS;
1377
- propFullName = propFullName || propName;
1378
-
1379
- if (secret !== ReactPropTypesSecret) {
1380
- if (throwOnDirectAccess) {
1381
- // New behavior only for users of `prop-types` package
1382
- var err = new Error(
1383
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1384
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
1385
- 'Read more at http://fb.me/use-check-prop-types'
1386
- );
1387
- err.name = 'Invariant Violation';
1388
- throw err;
1389
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1390
- // Old behavior for people using React.PropTypes
1391
- var cacheKey = componentName + ':' + propName;
1392
- if (
1393
- !manualPropTypeCallCache[cacheKey] &&
1394
- // Avoid spamming the console because they are often not actionable except for lib authors
1395
- manualPropTypeWarningCount < 3
1396
- ) {
1397
- printWarning(
1398
- 'You are manually calling a React.PropTypes validation ' +
1399
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1400
- 'and will throw in the standalone `prop-types` package. ' +
1401
- 'You may be seeing this warning due to a third-party PropTypes ' +
1402
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1403
- );
1404
- manualPropTypeCallCache[cacheKey] = true;
1405
- manualPropTypeWarningCount++;
1406
- }
1407
- }
1408
- }
1409
- if (props[propName] == null) {
1410
- if (isRequired) {
1411
- if (props[propName] === null) {
1412
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1413
- }
1414
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1415
- }
1416
- return null;
1417
- } else {
1418
- return validate(props, propName, componentName, location, propFullName);
1419
- }
1420
- }
1421
-
1422
- var chainedCheckType = checkType.bind(null, false);
1423
- chainedCheckType.isRequired = checkType.bind(null, true);
1424
-
1425
- return chainedCheckType;
1426
- }
1427
-
1428
- function createPrimitiveTypeChecker(expectedType) {
1429
- function validate(props, propName, componentName, location, propFullName, secret) {
1430
- var propValue = props[propName];
1431
- var propType = getPropType(propValue);
1432
- if (propType !== expectedType) {
1433
- // `propValue` being instance of, say, date/regexp, pass the 'object'
1434
- // check, but we can offer a more precise error message here rather than
1435
- // 'of type `object`'.
1436
- var preciseType = getPreciseType(propValue);
1437
-
1438
- return new PropTypeError(
1439
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
1440
- {expectedType: expectedType}
1441
- );
1442
- }
1443
- return null;
1444
- }
1445
- return createChainableTypeChecker(validate);
1446
- }
1447
-
1448
- function createAnyTypeChecker() {
1449
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1450
- }
1451
-
1452
- function createArrayOfTypeChecker(typeChecker) {
1453
- function validate(props, propName, componentName, location, propFullName) {
1454
- if (typeof typeChecker !== 'function') {
1455
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1456
- }
1457
- var propValue = props[propName];
1458
- if (!Array.isArray(propValue)) {
1459
- var propType = getPropType(propValue);
1460
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1461
- }
1462
- for (var i = 0; i < propValue.length; i++) {
1463
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1464
- if (error instanceof Error) {
1465
- return error;
1466
- }
1467
- }
1468
- return null;
1469
- }
1470
- return createChainableTypeChecker(validate);
1471
- }
1472
-
1473
- function createElementTypeChecker() {
1474
- function validate(props, propName, componentName, location, propFullName) {
1475
- var propValue = props[propName];
1476
- if (!isValidElement(propValue)) {
1477
- var propType = getPropType(propValue);
1478
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1479
- }
1480
- return null;
1481
- }
1482
- return createChainableTypeChecker(validate);
1483
- }
1484
-
1485
- function createElementTypeTypeChecker() {
1486
- function validate(props, propName, componentName, location, propFullName) {
1487
- var propValue = props[propName];
1488
- if (!ReactIs.isValidElementType(propValue)) {
1489
- var propType = getPropType(propValue);
1490
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1491
- }
1492
- return null;
1493
- }
1494
- return createChainableTypeChecker(validate);
1495
- }
1496
-
1497
- function createInstanceTypeChecker(expectedClass) {
1498
- function validate(props, propName, componentName, location, propFullName) {
1499
- if (!(props[propName] instanceof expectedClass)) {
1500
- var expectedClassName = expectedClass.name || ANONYMOUS;
1501
- var actualClassName = getClassName(props[propName]);
1502
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1503
- }
1504
- return null;
1505
- }
1506
- return createChainableTypeChecker(validate);
1507
- }
1508
-
1509
- function createEnumTypeChecker(expectedValues) {
1510
- if (!Array.isArray(expectedValues)) {
1511
- if (process.env.NODE_ENV !== 'production') {
1512
- if (arguments.length > 1) {
1513
- printWarning(
1514
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1515
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1516
- );
1517
- } else {
1518
- printWarning('Invalid argument supplied to oneOf, expected an array.');
1519
- }
1520
- }
1521
- return emptyFunctionThatReturnsNull;
1522
- }
1523
-
1524
- function validate(props, propName, componentName, location, propFullName) {
1525
- var propValue = props[propName];
1526
- for (var i = 0; i < expectedValues.length; i++) {
1527
- if (is(propValue, expectedValues[i])) {
1528
- return null;
1529
- }
1530
- }
1531
-
1532
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1533
- var type = getPreciseType(value);
1534
- if (type === 'symbol') {
1535
- return String(value);
1536
- }
1537
- return value;
1538
- });
1539
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1540
- }
1541
- return createChainableTypeChecker(validate);
1542
- }
1543
-
1544
- function createObjectOfTypeChecker(typeChecker) {
1545
- function validate(props, propName, componentName, location, propFullName) {
1546
- if (typeof typeChecker !== 'function') {
1547
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1548
- }
1549
- var propValue = props[propName];
1550
- var propType = getPropType(propValue);
1551
- if (propType !== 'object') {
1552
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1553
- }
1554
- for (var key in propValue) {
1555
- if (has(propValue, key)) {
1556
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1557
- if (error instanceof Error) {
1558
- return error;
1559
- }
1560
- }
1561
- }
1562
- return null;
1563
- }
1564
- return createChainableTypeChecker(validate);
1565
- }
1566
-
1567
- function createUnionTypeChecker(arrayOfTypeCheckers) {
1568
- if (!Array.isArray(arrayOfTypeCheckers)) {
1569
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1570
- return emptyFunctionThatReturnsNull;
1571
- }
1572
-
1573
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1574
- var checker = arrayOfTypeCheckers[i];
1575
- if (typeof checker !== 'function') {
1576
- printWarning(
1577
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1578
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1579
- );
1580
- return emptyFunctionThatReturnsNull;
1581
- }
1582
- }
1583
-
1584
- function validate(props, propName, componentName, location, propFullName) {
1585
- var expectedTypes = [];
1586
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1587
- var checker = arrayOfTypeCheckers[i];
1588
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1589
- if (checkerResult == null) {
1590
- return null;
1591
- }
1592
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1593
- expectedTypes.push(checkerResult.data.expectedType);
1594
- }
1595
- }
1596
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1597
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1598
- }
1599
- return createChainableTypeChecker(validate);
1600
- }
1601
-
1602
- function createNodeChecker() {
1603
- function validate(props, propName, componentName, location, propFullName) {
1604
- if (!isNode(props[propName])) {
1605
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1606
- }
1607
- return null;
1608
- }
1609
- return createChainableTypeChecker(validate);
1610
- }
1611
-
1612
- function invalidValidatorError(componentName, location, propFullName, key, type) {
1613
- return new PropTypeError(
1614
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1615
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1616
- );
1617
- }
1618
-
1619
- function createShapeTypeChecker(shapeTypes) {
1620
- function validate(props, propName, componentName, location, propFullName) {
1621
- var propValue = props[propName];
1622
- var propType = getPropType(propValue);
1623
- if (propType !== 'object') {
1624
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1625
- }
1626
- for (var key in shapeTypes) {
1627
- var checker = shapeTypes[key];
1628
- if (typeof checker !== 'function') {
1629
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1630
- }
1631
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1632
- if (error) {
1633
- return error;
1634
- }
1635
- }
1636
- return null;
1637
- }
1638
- return createChainableTypeChecker(validate);
1639
- }
1640
-
1641
- function createStrictShapeTypeChecker(shapeTypes) {
1642
- function validate(props, propName, componentName, location, propFullName) {
1643
- var propValue = props[propName];
1644
- var propType = getPropType(propValue);
1645
- if (propType !== 'object') {
1646
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1647
- }
1648
- // We need to check all keys in case some are required but missing from props.
1649
- var allKeys = assign({}, props[propName], shapeTypes);
1650
- for (var key in allKeys) {
1651
- var checker = shapeTypes[key];
1652
- if (has(shapeTypes, key) && typeof checker !== 'function') {
1653
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1654
- }
1655
- if (!checker) {
1656
- return new PropTypeError(
1657
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1658
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1659
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1660
- );
1661
- }
1662
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1663
- if (error) {
1664
- return error;
1665
- }
1666
- }
1667
- return null;
1668
- }
1669
-
1670
- return createChainableTypeChecker(validate);
1671
- }
1672
-
1673
- function isNode(propValue) {
1674
- switch (typeof propValue) {
1675
- case 'number':
1676
- case 'string':
1677
- case 'undefined':
1678
- return true;
1679
- case 'boolean':
1680
- return !propValue;
1681
- case 'object':
1682
- if (Array.isArray(propValue)) {
1683
- return propValue.every(isNode);
1684
- }
1685
- if (propValue === null || isValidElement(propValue)) {
1686
- return true;
1687
- }
1688
-
1689
- var iteratorFn = getIteratorFn(propValue);
1690
- if (iteratorFn) {
1691
- var iterator = iteratorFn.call(propValue);
1692
- var step;
1693
- if (iteratorFn !== propValue.entries) {
1694
- while (!(step = iterator.next()).done) {
1695
- if (!isNode(step.value)) {
1696
- return false;
1697
- }
1698
- }
1699
- } else {
1700
- // Iterator will provide entry [k,v] tuples rather than values.
1701
- while (!(step = iterator.next()).done) {
1702
- var entry = step.value;
1703
- if (entry) {
1704
- if (!isNode(entry[1])) {
1705
- return false;
1706
- }
1707
- }
1708
- }
1709
- }
1710
- } else {
1711
- return false;
1712
- }
1713
-
1714
- return true;
1715
- default:
1716
- return false;
1717
- }
1718
- }
1719
-
1720
- function isSymbol(propType, propValue) {
1721
- // Native Symbol.
1722
- if (propType === 'symbol') {
1723
- return true;
1724
- }
1725
-
1726
- // falsy value can't be a Symbol
1727
- if (!propValue) {
1728
- return false;
1729
- }
1730
-
1731
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1732
- if (propValue['@@toStringTag'] === 'Symbol') {
1733
- return true;
1734
- }
1735
-
1736
- // Fallback for non-spec compliant Symbols which are polyfilled.
1737
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1738
- return true;
1739
- }
1740
-
1741
- return false;
1742
- }
1743
-
1744
- // Equivalent of `typeof` but with special handling for array and regexp.
1745
- function getPropType(propValue) {
1746
- var propType = typeof propValue;
1747
- if (Array.isArray(propValue)) {
1748
- return 'array';
1749
- }
1750
- if (propValue instanceof RegExp) {
1751
- // Old webkits (at least until Android 4.0) return 'function' rather than
1752
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1753
- // passes PropTypes.object.
1754
- return 'object';
1755
- }
1756
- if (isSymbol(propType, propValue)) {
1757
- return 'symbol';
1758
- }
1759
- return propType;
1760
- }
1761
-
1762
- // This handles more types than `getPropType`. Only used for error messages.
1763
- // See `createPrimitiveTypeChecker`.
1764
- function getPreciseType(propValue) {
1765
- if (typeof propValue === 'undefined' || propValue === null) {
1766
- return '' + propValue;
1767
- }
1768
- var propType = getPropType(propValue);
1769
- if (propType === 'object') {
1770
- if (propValue instanceof Date) {
1771
- return 'date';
1772
- } else if (propValue instanceof RegExp) {
1773
- return 'regexp';
1774
- }
1775
- }
1776
- return propType;
1777
- }
1778
-
1779
- // Returns a string that is postfixed to a warning about an invalid type.
1780
- // For example, "undefined" or "of type array"
1781
- function getPostfixForTypeWarning(value) {
1782
- var type = getPreciseType(value);
1783
- switch (type) {
1784
- case 'array':
1785
- case 'object':
1786
- return 'an ' + type;
1787
- case 'boolean':
1788
- case 'date':
1789
- case 'regexp':
1790
- return 'a ' + type;
1791
- default:
1792
- return type;
1793
- }
1794
- }
1795
-
1796
- // Returns class name of the object, if any.
1797
- function getClassName(propValue) {
1798
- if (!propValue.constructor || !propValue.constructor.name) {
1799
- return ANONYMOUS;
1800
- }
1801
- return propValue.constructor.name;
1802
- }
1803
-
1804
- ReactPropTypes.checkPropTypes = checkPropTypes;
1805
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1806
- ReactPropTypes.PropTypes = ReactPropTypes;
1807
-
1808
- return ReactPropTypes;
1809
- };
1810
- return factoryWithTypeCheckers;
1811
- }
1812
-
1813
- /**
1814
- * Copyright (c) 2013-present, Facebook, Inc.
1815
- *
1816
- * This source code is licensed under the MIT license found in the
1817
- * LICENSE file in the root directory of this source tree.
1818
- */
1819
-
1820
- var factoryWithThrowingShims;
1821
- var hasRequiredFactoryWithThrowingShims;
1822
-
1823
- function requireFactoryWithThrowingShims () {
1824
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1825
- hasRequiredFactoryWithThrowingShims = 1;
1826
-
1827
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1828
-
1829
- function emptyFunction() {}
1830
- function emptyFunctionWithReset() {}
1831
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1832
-
1833
- factoryWithThrowingShims = function() {
1834
- function shim(props, propName, componentName, location, propFullName, secret) {
1835
- if (secret === ReactPropTypesSecret) {
1836
- // It is still safe when called from React.
1837
- return;
1838
- }
1839
- var err = new Error(
1840
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1841
- 'Use PropTypes.checkPropTypes() to call them. ' +
1842
- 'Read more at http://fb.me/use-check-prop-types'
1843
- );
1844
- err.name = 'Invariant Violation';
1845
- throw err;
1846
- } shim.isRequired = shim;
1847
- function getShim() {
1848
- return shim;
1849
- } // Important!
1850
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1851
- var ReactPropTypes = {
1852
- array: shim,
1853
- bigint: shim,
1854
- bool: shim,
1855
- func: shim,
1856
- number: shim,
1857
- object: shim,
1858
- string: shim,
1859
- symbol: shim,
1860
-
1861
- any: shim,
1862
- arrayOf: getShim,
1863
- element: shim,
1864
- elementType: shim,
1865
- instanceOf: getShim,
1866
- node: shim,
1867
- objectOf: getShim,
1868
- oneOf: getShim,
1869
- oneOfType: getShim,
1870
- shape: getShim,
1871
- exact: getShim,
1872
-
1873
- checkPropTypes: emptyFunctionWithReset,
1874
- resetWarningCache: emptyFunction
1875
- };
1876
-
1877
- ReactPropTypes.PropTypes = ReactPropTypes;
1878
-
1879
- return ReactPropTypes;
1880
- };
1881
- return factoryWithThrowingShims;
1882
- }
1883
-
1884
- /**
1885
- * Copyright (c) 2013-present, Facebook, Inc.
1886
- *
1887
- * This source code is licensed under the MIT license found in the
1888
- * LICENSE file in the root directory of this source tree.
1889
- */
1890
-
1891
- if (process.env.NODE_ENV !== 'production') {
1892
- var ReactIs = requireReactIs();
1893
-
1894
- // By explicitly using `prop-types` you are opting into new development behavior.
1895
- // http://fb.me/prop-types-in-prod
1896
- var throwOnDirectAccess = true;
1897
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1898
- } else {
1899
- // By explicitly using `prop-types` you are opting into new production behavior.
1900
- // http://fb.me/prop-types-in-prod
1901
- propTypes.exports = requireFactoryWithThrowingShims()();
1902
- }
1903
-
1904
- var MemoizedEditorContent = /*#__PURE__*/React.memo(EditorContent);
1905
- var EmailPreview = withT(function (_ref) {
1906
- var t = _ref.t,
1907
- _ref$to = _ref.to,
1908
- to = _ref$to === void 0 ? [] : _ref$to,
1909
- from = _ref.from,
1910
- subject = _ref.subject,
1911
- body = _ref.body,
1912
- productName = _ref.productName,
1913
- actionButtonText = _ref.actionButtonText,
1914
- logo = _ref.logo,
1915
- _ref$className = _ref.className,
1916
- className = _ref$className === void 0 ? "" : _ref$className;
1917
- return /*#__PURE__*/React.createElement("div", {
1918
- "data-cy": "email-preview-card",
1919
- "data-testid": "email-preview",
1920
- className: classnames("neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border", className)
1921
- }, /*#__PURE__*/React.createElement("div", {
1922
- className: "neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6"
1923
- }, /*#__PURE__*/React.createElement("div", {
1924
- className: "flex gap-2",
1925
- "data-cy": "email-send-to-preview",
1926
- "data-testid": "email-to-block"
1927
- }, /*#__PURE__*/React.createElement(Typography, {
1928
- className: "neeto-ui-text-gray-500",
1929
- lineHeight: "normal",
1930
- style: "body2"
1931
- }, t("neetoMolecules.emailPreview.to"), ":"), isPresent(to) ? /*#__PURE__*/React.createElement(Typography, {
1932
- className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1933
- lineHeight: "normal",
1934
- style: "body2"
1935
- }, to.join(", ")) : /*#__PURE__*/React.createElement("div", {
1936
- className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40"
1937
- })), from && /*#__PURE__*/React.createElement("div", {
1938
- className: "flex items-center gap-2 pt-3"
1939
- }, /*#__PURE__*/React.createElement(Typography, {
1940
- className: "neeto-ui-text-gray-500",
1941
- lineHeight: "normal",
1942
- style: "body2"
1943
- }, t("neetoMolecules.emailPreview.from"), ":"), /*#__PURE__*/React.createElement(Typography, {
1944
- className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1945
- "data-cy": "email-send-from-preview",
1946
- lineHeight: "normal",
1947
- style: "body2"
1948
- }, from)), /*#__PURE__*/React.createElement("div", {
1949
- className: "flex items-center gap-2 pt-3"
1950
- }, /*#__PURE__*/React.createElement(Typography, {
1951
- className: "neeto-ui-text-gray-500",
1952
- lineHeight: "normal",
1953
- style: "body2"
1954
- }, t("neetoMolecules.emailPreview.subject"), ":"), /*#__PURE__*/React.createElement(Typography, {
1955
- className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1956
- "data-cy": "email-subject-preview",
1957
- lineHeight: "normal",
1958
- style: "body2"
1959
- }, subject || /*#__PURE__*/React.createElement("span", {
1960
- className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40"
1961
- })))), /*#__PURE__*/React.createElement("div", {
1962
- className: "neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
1963
- "data-cy": "email-body-preview-container"
1964
- }, body ? /*#__PURE__*/React.createElement(MemoizedEditorContent, {
1965
- content: body
1966
- }) : /*#__PURE__*/React.createElement("div", {
1967
- className: "space-y-4"
1968
- }, /*#__PURE__*/React.createElement("div", {
1969
- className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
1970
- }), /*#__PURE__*/React.createElement("div", {
1971
- className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-72"
1972
- }), /*#__PURE__*/React.createElement("div", {
1973
- className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
1974
- })), actionButtonText && /*#__PURE__*/React.createElement("div", {
1975
- className: "mt-6 flex w-full items-center justify-center"
1976
- }, /*#__PURE__*/React.createElement(Button, {
1977
- className: "pointer-events-none",
1978
- label: actionButtonText
1979
- })), logo && /*#__PURE__*/React.createElement("img", {
1980
- alt: t("neetoMolecules.emailPreview.logoAltText"),
1981
- className: "h-20 w-36 object-cover",
1982
- "data-cy": "company-logo-preview",
1983
- src: logo
1984
- })), productName && /*#__PURE__*/React.createElement("div", {
1985
- className: "neeto-ui-bg-gray-100 mt-auto p-2",
1986
- "data-testid": "product-name-block"
1987
- }, /*#__PURE__*/React.createElement(Typography, {
1988
- className: "neeto-ui-text-gray-600 text-center leading-6",
1989
- style: "body3"
1990
- }, t("neetoMolecules.emailPreview.poweredBy"), /*#__PURE__*/React.createElement("span", {
1991
- className: "neeto-ui-text-gray-800 font-medium"
1992
- }, productName))));
1993
- });
1994
- EmailPreview.propTypes = {
1995
- /**
1996
- * The value of the send-to field.
1997
- */
1998
- to: propTypes.exports.arrayOf(propTypes.exports.string),
1999
- /**
2000
- * The value of the send-from field.
2001
- */
2002
- from: propTypes.exports.string,
2003
- /**
2004
- * The subject of the email.
2005
- */
2006
- subject: propTypes.exports.string,
2007
- /**
2008
- * The body of the email.
2009
- */
2010
- body: propTypes.exports.string,
2011
- /**
2012
- * The name of the neeto product to be previewed.
2013
- */
2014
- productName: propTypes.exports.string,
2015
- /**
2016
- * The text to be shown in the action button.
2017
- */
2018
- actionButtonText: propTypes.exports.string,
2019
- /**
2020
- * Source link for the company logo.
2021
- */
2022
- logo: propTypes.exports.string
2023
- };
2024
-
2025
- export { EmailForm, EmailFormProvider, EmailPreview };
363
+ export { EmailForm, EmailFormProvider };
2026
364
  //# sourceMappingURL=EmailForm.js.map