@bigbinary/neeto-molecules 1.1.15 → 1.1.17

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 (381) hide show
  1. package/README.md +1 -0
  2. package/dist/AutoSaveInput.js +658 -0
  3. package/dist/AutoSaveInput.js.map +1 -0
  4. package/dist/Breadcrumbs.js +38 -0
  5. package/dist/Breadcrumbs.js.map +1 -0
  6. package/dist/BrowserSupport.js +418 -0
  7. package/dist/BrowserSupport.js.map +1 -0
  8. package/dist/Builder.js +662 -0
  9. package/dist/Builder.js.map +1 -0
  10. package/dist/CalendarView.js +538 -0
  11. package/dist/CalendarView.js.map +1 -0
  12. package/dist/Codeblock.js +236 -0
  13. package/dist/Codeblock.js.map +1 -0
  14. package/dist/{Columns/index.js → Columns.js} +130 -13
  15. package/dist/Columns.js.map +1 -0
  16. package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
  17. package/dist/ConfirmationModal.js.map +1 -0
  18. package/dist/Container.js +1211 -0
  19. package/dist/Container.js.map +1 -0
  20. package/dist/CopyToClipboardButton.js +209 -0
  21. package/dist/CopyToClipboardButton.js.map +1 -0
  22. package/dist/CustomDomain.js +688 -0
  23. package/dist/CustomDomain.js.map +1 -0
  24. package/dist/CustomDomainDashboard.js +2283 -0
  25. package/dist/CustomDomainDashboard.js.map +1 -0
  26. package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
  27. package/dist/DateFormat.js.map +1 -0
  28. package/dist/DateRangeFilter.js +229 -0
  29. package/dist/DateRangeFilter.js.map +1 -0
  30. package/dist/DynamicVariables.js +183 -0
  31. package/dist/DynamicVariables.js.map +1 -0
  32. package/dist/EmailForm.js +2291 -0
  33. package/dist/EmailForm.js.map +1 -0
  34. package/dist/EmailPreview.js +1353 -0
  35. package/dist/EmailPreview.js.map +1 -0
  36. package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
  37. package/dist/ErrorPage.js.map +1 -0
  38. package/dist/Header.js +122 -0
  39. package/dist/Header.js.map +1 -0
  40. package/dist/IconPicker.js +313 -0
  41. package/dist/IconPicker.js.map +1 -0
  42. package/dist/ImageWithFallback.js +181 -0
  43. package/dist/ImageWithFallback.js.map +1 -0
  44. package/dist/IntegrationCard.js +343 -0
  45. package/dist/IntegrationCard.js.map +1 -0
  46. package/dist/IntegrationDisconnectAlert.js +80 -0
  47. package/dist/IntegrationDisconnectAlert.js.map +1 -0
  48. package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
  49. package/dist/IntegrationWalkthroughModal.js.map +1 -0
  50. package/dist/IpRestriction.js +857 -0
  51. package/dist/IpRestriction.js.map +1 -0
  52. package/dist/KeyboardShortcuts.js +359 -0
  53. package/dist/KeyboardShortcuts.js.map +1 -0
  54. package/dist/LoginPage.js +593 -0
  55. package/dist/LoginPage.js.map +1 -0
  56. package/dist/MenuBar.js +1461 -0
  57. package/dist/MenuBar.js.map +1 -0
  58. package/dist/Metadata.js +206 -0
  59. package/dist/Metadata.js.map +1 -0
  60. package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
  61. package/dist/MoreDropdown.js.map +1 -0
  62. package/dist/NavigationHeader.js +690 -0
  63. package/dist/NavigationHeader.js.map +1 -0
  64. package/dist/NeetoWidget.js +1333 -0
  65. package/dist/NeetoWidget.js.map +1 -0
  66. package/dist/PageLoader.js +134 -0
  67. package/dist/PageLoader.js.map +1 -0
  68. package/dist/PhoneNumber.js +365 -0
  69. package/dist/PhoneNumber.js.map +1 -0
  70. package/dist/PublishBlock.js +158 -0
  71. package/dist/PublishBlock.js.map +1 -0
  72. package/dist/Rename.js +450 -0
  73. package/dist/Rename.js.map +1 -0
  74. package/dist/ResponsiveDevicePicker.js +194 -0
  75. package/dist/ResponsiveDevicePicker.js.map +1 -0
  76. package/dist/Schedule.js +1046 -0
  77. package/dist/Schedule.js.map +1 -0
  78. package/dist/Scrollable.js +122 -0
  79. package/dist/Scrollable.js.map +1 -0
  80. package/dist/Search.js +151 -0
  81. package/dist/Search.js.map +1 -0
  82. package/dist/Security.js +1835 -0
  83. package/dist/Security.js.map +1 -0
  84. package/dist/SendToFields.js +601 -0
  85. package/dist/SendToFields.js.map +1 -0
  86. package/dist/Settings.js +435 -0
  87. package/dist/Settings.js.map +1 -0
  88. package/dist/ShareViaEmail.js +2277 -0
  89. package/dist/ShareViaEmail.js.map +1 -0
  90. package/dist/ShareViaLink.js +628 -0
  91. package/dist/ShareViaLink.js.map +1 -0
  92. package/dist/Sidebar.js +972 -0
  93. package/dist/Sidebar.js.map +1 -0
  94. package/dist/SubHeader.js +216 -0
  95. package/dist/SubHeader.js.map +1 -0
  96. package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
  97. package/dist/TableWrapper.js.map +1 -0
  98. package/dist/ThemeSidebar.js +1984 -0
  99. package/dist/ThemeSidebar.js.map +1 -0
  100. package/dist/TimeFormat.js +47 -0
  101. package/dist/TimeFormat.js.map +1 -0
  102. package/dist/TimezoneMismatchModal.js +168 -0
  103. package/dist/TimezoneMismatchModal.js.map +1 -0
  104. package/dist/ToggleFeatureCard.js +323 -0
  105. package/dist/ToggleFeatureCard.js.map +1 -0
  106. package/package.json +24 -13
  107. package/src/translations/en.json +10 -0
  108. package/types/Builder.d.ts +53 -0
  109. package/dist/AutoSaveInput/autosaveinput.scss +0 -15
  110. package/dist/AutoSaveInput/constants.js +0 -13
  111. package/dist/AutoSaveInput/index.js +0 -124
  112. package/dist/AutoSaveInput/utils.js +0 -10
  113. package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
  114. package/dist/Breadcrumbs/index.js +0 -31
  115. package/dist/BrowserSupport/Callout.js +0 -15
  116. package/dist/BrowserSupport/ContactUs.js +0 -21
  117. package/dist/BrowserSupport/DownloadLink.js +0 -17
  118. package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
  119. package/dist/BrowserSupport/UnknownBrowser.js +0 -13
  120. package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
  121. package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
  122. package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
  123. package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
  124. package/dist/BrowserSupport/browsersupport.scss +0 -71
  125. package/dist/BrowserSupport/constants.js +0 -63
  126. package/dist/BrowserSupport/index.js +0 -58
  127. package/dist/BrowserSupport/utils.js +0 -32
  128. package/dist/CalendarView/CustomDatePicker.js +0 -87
  129. package/dist/CalendarView/Header.js +0 -53
  130. package/dist/CalendarView/constants.js +0 -19
  131. package/dist/CalendarView/index.js +0 -83
  132. package/dist/CalendarView/utils.js +0 -50
  133. package/dist/Codeblock/index.js +0 -30
  134. package/dist/Columns/utils.js +0 -20
  135. package/dist/ConfirmationModal/constants.js +0 -3
  136. package/dist/ConfirmationModal/utils.js +0 -6
  137. package/dist/Container/container.scss +0 -21
  138. package/dist/Container/index.js +0 -23
  139. package/dist/CopyToClipboardButton/constants.js +0 -13
  140. package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
  141. package/dist/CopyToClipboardButton/index.js +0 -59
  142. package/dist/CustomDomain/index.js +0 -98
  143. package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
  144. package/dist/CustomDomainDashboard/Header.js +0 -32
  145. package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
  146. package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
  147. package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
  148. package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
  149. package/dist/CustomDomainDashboard/Manage/index.js +0 -124
  150. package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
  151. package/dist/CustomDomainDashboard/api.js +0 -35
  152. package/dist/CustomDomainDashboard/constants.js +0 -2
  153. package/dist/CustomDomainDashboard/index.js +0 -118
  154. package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
  155. package/dist/CustomDomainDashboard/utils.js +0 -84
  156. package/dist/DateRangeFilter/index.js +0 -60
  157. package/dist/DateRangeFilter/utils.js +0 -113
  158. package/dist/DynamicVariables/dynamic-variables.scss +0 -34
  159. package/dist/DynamicVariables/index.js +0 -59
  160. package/dist/DynamicVariables/utils.js +0 -37
  161. package/dist/EmailForm/EmailForm.js +0 -97
  162. package/dist/EmailForm/EmailFormProvider.js +0 -45
  163. package/dist/EmailForm/EmailPreview.js +0 -129
  164. package/dist/EmailForm/ReplyToField.js +0 -55
  165. package/dist/EmailForm/SendToField.js +0 -27
  166. package/dist/EmailForm/SubjectField.js +0 -64
  167. package/dist/EmailForm/constants.js +0 -33
  168. package/dist/EmailForm/contexts/EmailForm.js +0 -7
  169. package/dist/EmailForm/index.js +0 -4
  170. package/dist/EmailForm/utils.js +0 -10
  171. package/dist/EmailPreview/index.js +0 -2
  172. package/dist/ErrorPage/index.js +0 -78
  173. package/dist/Header/Breadcrumbs.js +0 -31
  174. package/dist/Header/Dropdown.js +0 -12
  175. package/dist/Header/constants.js +0 -6
  176. package/dist/Header/header.scss +0 -121
  177. package/dist/Header/index.js +0 -61
  178. package/dist/IconPicker/Icon.js +0 -34
  179. package/dist/IconPicker/NoResults.js +0 -12
  180. package/dist/IconPicker/constants.js +0 -8
  181. package/dist/IconPicker/icon-picker.scss +0 -1
  182. package/dist/IconPicker/index.js +0 -164
  183. package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
  184. package/dist/ImageWithFallback/index.js +0 -31
  185. package/dist/IntegrationCard/Dropdown.js +0 -45
  186. package/dist/IntegrationCard/Status.js +0 -25
  187. package/dist/IntegrationCard/index.js +0 -128
  188. package/dist/IntegrationDisconnectAlert/index.js +0 -36
  189. package/dist/IpRestriction/AllowedIpRanges.js +0 -75
  190. package/dist/IpRestriction/CurrentIp.js +0 -26
  191. package/dist/IpRestriction/FormRow.js +0 -84
  192. package/dist/IpRestriction/Row.js +0 -91
  193. package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
  194. package/dist/IpRestriction/apis/current_ip.js +0 -11
  195. package/dist/IpRestriction/apis/ip_restriction.js +0 -16
  196. package/dist/IpRestriction/constants.js +0 -20
  197. package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
  198. package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
  199. package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
  200. package/dist/IpRestriction/index.js +0 -102
  201. package/dist/IpRestriction/utils.js +0 -85
  202. package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
  203. package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
  204. package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
  205. package/dist/KeyboardShortcuts/Pane/index.js +0 -61
  206. package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
  207. package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
  208. package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
  209. package/dist/KeyboardShortcuts/index.js +0 -9
  210. package/dist/LoginPage/Form.js +0 -57
  211. package/dist/LoginPage/constants.js +0 -12
  212. package/dist/LoginPage/index.js +0 -103
  213. package/dist/MenuBar/AddNew.js +0 -25
  214. package/dist/MenuBar/Block.js +0 -60
  215. package/dist/MenuBar/Item.js +0 -32
  216. package/dist/MenuBar/Search.js +0 -39
  217. package/dist/MenuBar/SubTitle.js +0 -23
  218. package/dist/MenuBar/index.js +0 -46
  219. package/dist/MenuBar/menubar.scss +0 -154
  220. package/dist/Metadata/Block.js +0 -30
  221. package/dist/Metadata/DetailsBlock.js +0 -86
  222. package/dist/Metadata/constants.js +0 -9
  223. package/dist/Metadata/index.js +0 -29
  224. package/dist/Metadata/metadata.scss +0 -15
  225. package/dist/MoreDropdown/constants.js +0 -25
  226. package/dist/NavigationHeader/LeftBlock.js +0 -32
  227. package/dist/NavigationHeader/Navigation.js +0 -24
  228. package/dist/NavigationHeader/RightBlock.js +0 -68
  229. package/dist/NavigationHeader/constants.js +0 -11
  230. package/dist/NavigationHeader/index.js +0 -19
  231. package/dist/NavigationHeader/navigation-header.scss +0 -3
  232. package/dist/NeetoWidget/CodeBlock.js +0 -57
  233. package/dist/NeetoWidget/CodeSnippet.js +0 -119
  234. package/dist/NeetoWidget/EmbedCode.js +0 -281
  235. package/dist/NeetoWidget/Main.js +0 -19
  236. package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
  237. package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
  238. package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
  239. package/dist/NeetoWidget/api.js +0 -20
  240. package/dist/NeetoWidget/constants.js +0 -62
  241. package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
  242. package/dist/NeetoWidget/index.js +0 -7
  243. package/dist/NeetoWidget/mutations.js +0 -9
  244. package/dist/NeetoWidget/queries.js +0 -32
  245. package/dist/NeetoWidget/utils.js +0 -83
  246. package/dist/PageLoader/index.js +0 -81
  247. package/dist/PageLoader/page-loader.scss +0 -95
  248. package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
  249. package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
  250. package/dist/PhoneNumber/CountryPicker/index.js +0 -59
  251. package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
  252. package/dist/PhoneNumber/PhoneNumber.js +0 -30
  253. package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
  254. package/dist/PhoneNumber/index.js +0 -5
  255. package/dist/PhoneNumber/utils.js +0 -55
  256. package/dist/PublishBlock/AlertBlock.js +0 -14
  257. package/dist/PublishBlock/index.js +0 -100
  258. package/dist/PublishBlock/publish-block.scss +0 -25
  259. package/dist/Rename/DummySpan.js +0 -21
  260. package/dist/Rename/constants.js +0 -1
  261. package/dist/Rename/index.js +0 -191
  262. package/dist/Rename/rename.scss +0 -69
  263. package/dist/Rename/utils.js +0 -10
  264. package/dist/ResponsiveDevicePicker/constants.js +0 -19
  265. package/dist/ResponsiveDevicePicker/index.js +0 -36
  266. package/dist/Schedule/DisplayAvailability.js +0 -58
  267. package/dist/Schedule/Fields.js +0 -43
  268. package/dist/Schedule/Form/ScheduleRow.js +0 -125
  269. package/dist/Schedule/Form/constants.js +0 -20
  270. package/dist/Schedule/Form/index.js +0 -144
  271. package/dist/Schedule/Form/utils.js +0 -63
  272. package/dist/Schedule/Header.js +0 -76
  273. package/dist/Schedule/ScheduleContext.js +0 -8
  274. package/dist/Schedule/constants.js +0 -8
  275. package/dist/Schedule/dayjsExtended/constants.js +0 -1
  276. package/dist/Schedule/dayjsExtended/index.js +0 -14
  277. package/dist/Schedule/dayjsExtended/range.js +0 -73
  278. package/dist/Schedule/index.js +0 -80
  279. package/dist/Schedule/utils.js +0 -152
  280. package/dist/Scrollable/constants.js +0 -8
  281. package/dist/Scrollable/index.js +0 -26
  282. package/dist/Scrollable/scrollable.scss +0 -32
  283. package/dist/Search/index.js +0 -52
  284. package/dist/Security/AllowedKeywords/Add.js +0 -38
  285. package/dist/Security/AllowedKeywords/index.js +0 -38
  286. package/dist/Security/PasswordBlock.js +0 -31
  287. package/dist/Security/RadioBlock.js +0 -38
  288. package/dist/Security/api.js +0 -12
  289. package/dist/Security/constants.js +0 -58
  290. package/dist/Security/index.js +0 -68
  291. package/dist/Security/useSecurityApi.js +0 -22
  292. package/dist/Security/utils.js +0 -31
  293. package/dist/SendToFields/FilePicker.js +0 -34
  294. package/dist/SendToFields/constants.js +0 -6
  295. package/dist/SendToFields/index.js +0 -102
  296. package/dist/SendToFields/utils.js +0 -54
  297. package/dist/Settings/Category.js +0 -30
  298. package/dist/Settings/Item.js +0 -38
  299. package/dist/Settings/index.js +0 -37
  300. package/dist/Settings/utils.js +0 -4
  301. package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
  302. package/dist/ShareViaEmail/FilePicker.js +0 -43
  303. package/dist/ShareViaEmail/Form.js +0 -104
  304. package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
  305. package/dist/ShareViaEmail/constants.js +0 -14
  306. package/dist/ShareViaEmail/index.js +0 -92
  307. package/dist/ShareViaEmail/utils.js +0 -72
  308. package/dist/ShareViaLink/EditURL.js +0 -74
  309. package/dist/ShareViaLink/Link.js +0 -105
  310. package/dist/ShareViaLink/QRCode.js +0 -41
  311. package/dist/ShareViaLink/RegenerateURL.js +0 -47
  312. package/dist/ShareViaLink/SocialMedia.js +0 -52
  313. package/dist/ShareViaLink/constants.js +0 -25
  314. package/dist/ShareViaLink/edit-url.scss +0 -8
  315. package/dist/ShareViaLink/index.js +0 -46
  316. package/dist/ShareViaLink/utils.js +0 -47
  317. package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
  318. package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
  319. package/dist/Sidebar/AppSwitcher/Body.js +0 -65
  320. package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
  321. package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
  322. package/dist/Sidebar/AppSwitcher/index.js +0 -47
  323. package/dist/Sidebar/AppSwitcher/utils.js +0 -25
  324. package/dist/Sidebar/Chevron.js +0 -14
  325. package/dist/Sidebar/FeaturedTooltip.js +0 -19
  326. package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
  327. package/dist/Sidebar/Footer/ProfileButton.js +0 -30
  328. package/dist/Sidebar/Footer/index.js +0 -56
  329. package/dist/Sidebar/Footer/utils.js +0 -39
  330. package/dist/Sidebar/Header.js +0 -33
  331. package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
  332. package/dist/Sidebar/HelpSection/index.js +0 -32
  333. package/dist/Sidebar/Links.js +0 -112
  334. package/dist/Sidebar/NavIconWrapper.js +0 -20
  335. package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
  336. package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
  337. package/dist/Sidebar/ProfileSection/index.js +0 -42
  338. package/dist/Sidebar/constants.js +0 -40
  339. package/dist/Sidebar/index.js +0 -94
  340. package/dist/Sidebar/sidebar.scss +0 -379
  341. package/dist/Sidebar/utils.js +0 -18
  342. package/dist/SubHeader/RightBlock/Columns.js +0 -35
  343. package/dist/SubHeader/RightBlock/Download.js +0 -28
  344. package/dist/SubHeader/RightBlock/Filter.js +0 -31
  345. package/dist/SubHeader/RightBlock/index.js +0 -21
  346. package/dist/SubHeader/RightBlock/utils.js +0 -13
  347. package/dist/SubHeader/index.js +0 -28
  348. package/dist/SubHeader/subheader.scss +0 -78
  349. package/dist/ThemeSidebar/Customize/Logo.js +0 -39
  350. package/dist/ThemeSidebar/Customize/Properties.js +0 -170
  351. package/dist/ThemeSidebar/Customize/index.js +0 -66
  352. package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
  353. package/dist/ThemeSidebar/Themes/index.js +0 -110
  354. package/dist/ThemeSidebar/TitleBar.js +0 -62
  355. package/dist/ThemeSidebar/constants.js +0 -127
  356. package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
  357. package/dist/ThemeSidebar/fields/Card.js +0 -19
  358. package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
  359. package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
  360. package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
  361. package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
  362. package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
  363. package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
  364. package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
  365. package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
  366. package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
  367. package/dist/ThemeSidebar/fields/slider.scss +0 -199
  368. package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
  369. package/dist/ThemeSidebar/index.js +0 -118
  370. package/dist/ThemeSidebar/themeSidebar.scss +0 -45
  371. package/dist/ThemeSidebar/utils.js +0 -169
  372. package/dist/TimeFormat/index.js +0 -3
  373. package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
  374. package/dist/TimezoneMismatchModal/index.js +0 -83
  375. package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
  376. package/dist/TimezoneMismatchModal/utils.js +0 -12
  377. package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
  378. package/dist/ToggleFeatureCard/constants.js +0 -5
  379. package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
  380. package/dist/ToggleFeatureCard/index.js +0 -148
  381. package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
@@ -0,0 +1,688 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import { SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
3
+ import { snakeToCamelCase, isNotEmpty, noop } from '@bigbinary/neeto-commons-frontend/pure';
4
+ import { MenuVertical, MenuHorizontal, Info, Check, CustomDomain as CustomDomain$1 } from '@bigbinary/neeto-icons';
5
+ import { Alert, Dropdown, Tooltip, Button, Tag, Callout, Input, Pane, Typography, Label, Spinner } from '@bigbinary/neetoui';
6
+ import { useTranslation, Trans } from 'react-i18next';
7
+ import { Formik, Form } from 'formik';
8
+ import { Input as Input$1 } from '@bigbinary/neetoui/formik';
9
+ import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
10
+ import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
11
+ import { t } from 'i18next';
12
+ import { mergeRight } from 'ramda';
13
+ import classnames from 'classnames';
14
+ import * as Yup from 'yup';
15
+ import { useQueryClient, useMutation, useQuery } from 'react-query';
16
+ import axios from 'axios';
17
+
18
+ function _arrayWithHoles(arr) {
19
+ if (Array.isArray(arr)) return arr;
20
+ }
21
+
22
+ function _iterableToArrayLimit(arr, i) {
23
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
24
+ if (null != _i) {
25
+ var _s,
26
+ _e,
27
+ _x,
28
+ _r,
29
+ _arr = [],
30
+ _n = !0,
31
+ _d = !1;
32
+ try {
33
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
34
+ if (Object(_i) !== _i) return;
35
+ _n = !1;
36
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
37
+ } catch (err) {
38
+ _d = !0, _e = err;
39
+ } finally {
40
+ try {
41
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
42
+ } finally {
43
+ if (_d) throw _e;
44
+ }
45
+ }
46
+ return _arr;
47
+ }
48
+ }
49
+
50
+ function _arrayLikeToArray(arr, len) {
51
+ if (len == null || len > arr.length) len = arr.length;
52
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
53
+ return arr2;
54
+ }
55
+
56
+ function _unsupportedIterableToArray(o, minLen) {
57
+ if (!o) return;
58
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
59
+ var n = Object.prototype.toString.call(o).slice(8, -1);
60
+ if (n === "Object" && o.constructor) n = o.constructor.name;
61
+ if (n === "Map" || n === "Set") return Array.from(o);
62
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
63
+ }
64
+
65
+ function _nonIterableRest() {
66
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
67
+ }
68
+
69
+ function _slicedToArray(arr, i) {
70
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
71
+ }
72
+
73
+ var DeleteAlert = function DeleteAlert(_ref) {
74
+ var onClose = _ref.onClose,
75
+ onSubmit = _ref.onSubmit,
76
+ isOpen = _ref.isOpen,
77
+ isSubmitting = _ref.isSubmitting,
78
+ hostname = _ref.hostname;
79
+ var _useTranslation = useTranslation(),
80
+ t = _useTranslation.t;
81
+ return /*#__PURE__*/React.createElement(Alert, {
82
+ cancelButtonLabel: t("neetoMolecules.common.actions.cancel"),
83
+ isOpen: isOpen,
84
+ isSubmitting: isSubmitting,
85
+ submitButtonLabel: t("neetoMolecules.common.actions.delete"),
86
+ title: t("neetoMolecules.customDomain.delete"),
87
+ message: /*#__PURE__*/React.createElement(Trans, {
88
+ i18nKey: "neetoMolecules.customDomain.alertMessage",
89
+ values: {
90
+ hostname: hostname
91
+ }
92
+ }),
93
+ onClose: onClose,
94
+ onSubmit: onSubmit
95
+ });
96
+ };
97
+
98
+ var HOSTNAME_REGEX = /^(?!-)[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/;
99
+ var INITIAL_VALUES = {
100
+ hostname: ""
101
+ };
102
+
103
+ function _objectWithoutPropertiesLoose(source, excluded) {
104
+ if (source == null) return {};
105
+ var target = {};
106
+ var sourceKeys = Object.keys(source);
107
+ var key, i;
108
+ for (i = 0; i < sourceKeys.length; i++) {
109
+ key = sourceKeys[i];
110
+ if (excluded.indexOf(key) >= 0) continue;
111
+ target[key] = source[key];
112
+ }
113
+ return target;
114
+ }
115
+
116
+ function _objectWithoutProperties(source, excluded) {
117
+ if (source == null) return {};
118
+ var target = _objectWithoutPropertiesLoose(source, excluded);
119
+ var key, i;
120
+ if (Object.getOwnPropertySymbols) {
121
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
122
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
123
+ key = sourceSymbolKeys[i];
124
+ if (excluded.indexOf(key) >= 0) continue;
125
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
126
+ target[key] = source[key];
127
+ }
128
+ }
129
+ return target;
130
+ }
131
+
132
+ function _typeof(obj) {
133
+ "@babel/helpers - typeof";
134
+
135
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
136
+ return typeof obj;
137
+ } : function (obj) {
138
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
139
+ }, _typeof(obj);
140
+ }
141
+
142
+ function _toPrimitive(input, hint) {
143
+ if (_typeof(input) !== "object" || input === null) return input;
144
+ var prim = input[Symbol.toPrimitive];
145
+ if (prim !== undefined) {
146
+ var res = prim.call(input, hint || "default");
147
+ if (_typeof(res) !== "object") return res;
148
+ throw new TypeError("@@toPrimitive must return a primitive value.");
149
+ }
150
+ return (hint === "string" ? String : Number)(input);
151
+ }
152
+
153
+ function _toPropertyKey(arg) {
154
+ var key = _toPrimitive(arg, "string");
155
+ return _typeof(key) === "symbol" ? key : String(key);
156
+ }
157
+
158
+ function _defineProperty(obj, key, value) {
159
+ key = _toPropertyKey(key);
160
+ if (key in obj) {
161
+ Object.defineProperty(obj, key, {
162
+ value: value,
163
+ enumerable: true,
164
+ configurable: true,
165
+ writable: true
166
+ });
167
+ } else {
168
+ obj[key] = value;
169
+ }
170
+ return obj;
171
+ }
172
+
173
+ function _extends() {
174
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
175
+ for (var i = 1; i < arguments.length; i++) {
176
+ var source = arguments[i];
177
+ for (var key in source) {
178
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
179
+ target[key] = source[key];
180
+ }
181
+ }
182
+ }
183
+ return target;
184
+ };
185
+ return _extends.apply(this, arguments);
186
+ }
187
+
188
+ var MENU_ITEM_TYPES = {
189
+ menuItem: "menuItem",
190
+ divider: "divider"
191
+ };
192
+ var DEFAULT_TOOLTIP_PROPS = {
193
+ disabled: true,
194
+ position: "bottom"
195
+ };
196
+
197
+ var _excluded = ["key", "onClick", "label", "type", "isVisible"];
198
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
199
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
200
+ var Menu = Dropdown.Menu,
201
+ MenuItem = Dropdown.MenuItem,
202
+ Divider = Dropdown.Divider;
203
+ var MoreDropdown = function MoreDropdown(_ref) {
204
+ var _ref$dropdownButtonPr = _ref.dropdownButtonProps,
205
+ dropdownButtonProps = _ref$dropdownButtonPr === void 0 ? {} : _ref$dropdownButtonPr,
206
+ _ref$isVertical = _ref.isVertical,
207
+ isVertical = _ref$isVertical === void 0 ? false : _ref$isVertical,
208
+ _ref$isDisabled = _ref.isDisabled,
209
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
210
+ _ref$dropdownProps = _ref.dropdownProps,
211
+ dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
212
+ menuTopChildren = _ref.menuTopChildren,
213
+ menuBottomChildren = _ref.menuBottomChildren,
214
+ _ref$menuItems = _ref.menuItems,
215
+ menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems;
216
+ var tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, dropdownButtonProps.tooltipProps);
217
+ var targetIcon = isVertical ? MenuVertical : MenuHorizontal;
218
+ var isDropdownDisabled = isDisabled || dropdownProps.disabled;
219
+ if (isDropdownDisabled && !tooltipProps.disabled) {
220
+ return /*#__PURE__*/React.createElement(Tooltip, tooltipProps, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Button, _extends({
221
+ disabled: true,
222
+ "data-testid": "nui-dropdown-button",
223
+ icon: targetIcon,
224
+ iconPosition: "right",
225
+ size: "medium",
226
+ style: "text"
227
+ }, dropdownButtonProps))));
228
+ }
229
+ return /*#__PURE__*/React.createElement(Dropdown, _extends({
230
+ autoWidth: true,
231
+ className: "flex",
232
+ disabled: isDisabled,
233
+ icon: targetIcon,
234
+ buttonProps: _objectSpread$1({
235
+ className: "min-h-0 flex-shrink-0",
236
+ style: "text"
237
+ }, dropdownButtonProps)
238
+ }, dropdownProps), /*#__PURE__*/React.createElement(Menu, null, menuTopChildren, menuItems.map(function (_ref2) {
239
+ var key = _ref2.key,
240
+ onClick = _ref2.onClick,
241
+ label = _ref2.label,
242
+ _ref2$type = _ref2.type,
243
+ type = _ref2$type === void 0 ? MENU_ITEM_TYPES.menuItem : _ref2$type,
244
+ _ref2$isVisible = _ref2.isVisible,
245
+ isVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
246
+ menuItemProps = _objectWithoutProperties(_ref2, _excluded);
247
+ if (!isVisible) return null;
248
+ return type === MENU_ITEM_TYPES.menuItem ? /*#__PURE__*/React.createElement(MenuItem.Button, _extends({
249
+ key: key
250
+ }, _objectSpread$1({
251
+ onClick: onClick
252
+ }, menuItemProps)), label) : /*#__PURE__*/React.createElement(Divider, {
253
+ key: key
254
+ });
255
+ }), menuBottomChildren));
256
+ };
257
+
258
+ var TagBlock = function TagBlock(_ref) {
259
+ var status = _ref.status,
260
+ _ref$stacked = _ref.stacked,
261
+ stacked = _ref$stacked === void 0 ? false : _ref$stacked;
262
+ var _useTranslation = useTranslation(),
263
+ t = _useTranslation.t;
264
+ var isDomainValidated = status === "active" || status === "pending_cname_validation";
265
+ var camelCasedStatus = snakeToCamelCase(status || "");
266
+ return /*#__PURE__*/React.createElement("div", {
267
+ className: classnames("flex gap-2", {
268
+ "flex-col items-start": stacked
269
+ })
270
+ }, status === "failed" ? /*#__PURE__*/React.createElement(Tag, {
271
+ indicatorStyle: "danger",
272
+ label: t("neetoMolecules.customDomain.status.".concat(camelCasedStatus)),
273
+ style: "secondary"
274
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, {
275
+ indicatorStyle: isDomainValidated ? "success" : "warning",
276
+ style: "secondary",
277
+ label: t("neetoMolecules.customDomain.status.domain.".concat(camelCasedStatus))
278
+ }), isDomainValidated && /*#__PURE__*/React.createElement("div", {
279
+ className: classnames("flex items-center justify-between gap-2", {
280
+ "w-full": stacked
281
+ })
282
+ }, /*#__PURE__*/React.createElement(Tag, {
283
+ indicatorStyle: status === "active" ? "success" : "warning",
284
+ style: "secondary",
285
+ label: t("neetoMolecules.customDomain.status.cname.".concat(camelCasedStatus))
286
+ }))));
287
+ };
288
+ var TagBlock$1 = /*#__PURE__*/React.memo(TagBlock);
289
+
290
+ var recordData = function recordData(customDomain) {
291
+ var status = customDomain.status,
292
+ hostname = customDomain.hostname,
293
+ dnsTarget = customDomain.dnsTarget,
294
+ cnameValidationParams = customDomain.cnameValidationParams;
295
+ var isDomainValidated = status === "active" || status === "pending_cname_validation";
296
+ var recordName = isDomainValidated ? hostname : cnameValidationParams === null || cnameValidationParams === void 0 ? void 0 : cnameValidationParams.name;
297
+ var recordValue = isDomainValidated ? dnsTarget : cnameValidationParams === null || cnameValidationParams === void 0 ? void 0 : cnameValidationParams.value;
298
+ var recordType = isDomainValidated ? t("neetoMolecules.customDomain.cname") : t("neetoMolecules.customDomain.domainValidationCname");
299
+ var recordDescription = isDomainValidated ? t("neetoMolecules.customDomain.validation.desc", {
300
+ record: recordType
301
+ }) : t("neetoMolecules.customDomain.validation.desc", {
302
+ record: recordType,
303
+ proxyMessage: t("neetoMolecules.customDomain.validation.proxyMessage")
304
+ });
305
+ var recordNameLabel = t("neetoMolecules.customDomain.validation.record", {
306
+ record: recordType,
307
+ type: t("neetoMolecules.common.name")
308
+ });
309
+ var recordValueLabel = t("neetoMolecules.customDomain.validation.record", {
310
+ record: recordType,
311
+ type: t("neetoMolecules.common.value")
312
+ });
313
+ return {
314
+ recordName: recordName,
315
+ recordValue: recordValue,
316
+ recordDescription: recordDescription,
317
+ recordNameLabel: recordNameLabel,
318
+ recordValueLabel: recordValueLabel
319
+ };
320
+ };
321
+
322
+ var Record = function Record(_ref) {
323
+ var customDomain = _ref.customDomain;
324
+ var _recordData = recordData(customDomain),
325
+ recordName = _recordData.recordName,
326
+ recordValue = _recordData.recordValue,
327
+ recordDescription = _recordData.recordDescription,
328
+ recordNameLabel = _recordData.recordNameLabel,
329
+ recordValueLabel = _recordData.recordValueLabel;
330
+ return /*#__PURE__*/React.createElement("div", {
331
+ className: "mt-6 grid gap-4"
332
+ }, customDomain.status !== "active" && /*#__PURE__*/React.createElement(Callout, {
333
+ icon: Info,
334
+ style: "info"
335
+ }, recordDescription), /*#__PURE__*/React.createElement(Input, {
336
+ disabled: true,
337
+ "data-cy": joinHyphenCase(recordNameLabel),
338
+ label: recordNameLabel,
339
+ value: recordName,
340
+ suffix: /*#__PURE__*/React.createElement(CopyToClipboardButton, {
341
+ size: "small",
342
+ style: "text",
343
+ value: recordName
344
+ })
345
+ }), /*#__PURE__*/React.createElement(Input, {
346
+ disabled: true,
347
+ "data-cy": joinHyphenCase(recordValueLabel),
348
+ label: recordValueLabel,
349
+ value: recordValue,
350
+ suffix: /*#__PURE__*/React.createElement(CopyToClipboardButton, {
351
+ size: "small",
352
+ style: "text",
353
+ value: recordValue
354
+ })
355
+ }));
356
+ };
357
+ var Record$1 = /*#__PURE__*/React.memo(Record);
358
+
359
+ var StatusInfo = function StatusInfo() {
360
+ var helpUrl = "https://help.".concat(globalProps.appName.toLowerCase(), ".com/articles/custom-domains");
361
+ return /*#__PURE__*/React.createElement("div", {
362
+ className: "space-y-6"
363
+ }, /*#__PURE__*/React.createElement("div", {
364
+ className: "neeto-ui-rounded neeto-ui-bg-gray-100 neeto-ui-text-gray-700 space-y-3 p-4"
365
+ }, /*#__PURE__*/React.createElement(Trans, {
366
+ i18nKey: "neetoMolecules.customDomain.messageBlock.dnsStatus",
367
+ components: {
368
+ a: /*#__PURE__*/React.createElement("a", {
369
+ className: "neeto-ui-btn--style-link",
370
+ href: helpUrl,
371
+ rel: "noreferrer",
372
+ target: "_blank"
373
+ })
374
+ }
375
+ })));
376
+ };
377
+ var StatusInfo$1 = /*#__PURE__*/React.memo(StatusInfo);
378
+
379
+ var getCustomDomainValidationSchema = function getCustomDomainValidationSchema() {
380
+ return Yup.object().shape({
381
+ hostname: Yup.string().required(t("neetoMolecules.customDomain.formikValidation.required")).matches(HOSTNAME_REGEX, t("neetoMolecules.customDomain.formikValidation.valid"))
382
+ });
383
+ };
384
+
385
+ var getUrlwithId = function getUrlwithId(url, id) {
386
+ return id ? "".concat(url, "/").concat(id) : url;
387
+ };
388
+ var fetchCustomDomains = function fetchCustomDomains(_ref) {
389
+ var url = _ref.url,
390
+ params = _ref.params;
391
+ return axios.get(url, {
392
+ params: params
393
+ });
394
+ };
395
+ var updateCustomDomain = function updateCustomDomain(url, id) {
396
+ return axios.patch(getUrlwithId(url, id));
397
+ };
398
+ var createCustomDomain = function createCustomDomain(url, payload) {
399
+ return axios.post(url, payload);
400
+ };
401
+ var deleteCustomDomain = function deleteCustomDomain(url, id) {
402
+ return axios["delete"](getUrlwithId(url, id));
403
+ };
404
+ var validateDomain = function validateDomain(url, id) {
405
+ return axios.patch("".concat(getUrlwithId(url, id), "/validate_domain"));
406
+ };
407
+ var validateCname = function validateCname(url, id) {
408
+ return axios.patch("".concat(getUrlwithId(url, id), "/validate_cname"));
409
+ };
410
+ var customDomainApi = {
411
+ createCustomDomain: createCustomDomain,
412
+ deleteCustomDomain: deleteCustomDomain,
413
+ validateDomain: validateDomain,
414
+ fetchCustomDomains: fetchCustomDomains,
415
+ validateCname: validateCname,
416
+ updateCustomDomain: updateCustomDomain
417
+ };
418
+
419
+ var DEFAULT_STALE_TIME = 60 * 60 * 1000;
420
+ var DOMAIN_QUERY_KEY = "custom-domain";
421
+
422
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
423
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
424
+ var useCreateCustomDomain = function useCreateCustomDomain(url) {
425
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
426
+ var queryClient = useQueryClient();
427
+ return useMutation(function (payload) {
428
+ return customDomainApi.createCustomDomain(url, payload);
429
+ }, _objectSpread(_objectSpread({}, options), {}, {
430
+ onSuccess: function onSuccess() {
431
+ return queryClient.invalidateQueries(DOMAIN_QUERY_KEY);
432
+ }
433
+ }));
434
+ };
435
+ var useDeleteCustomDomain = function useDeleteCustomDomain(url) {
436
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
437
+ var queryClient = useQueryClient();
438
+ return useMutation(function (id) {
439
+ return customDomainApi.deleteCustomDomain(url, id);
440
+ }, _objectSpread(_objectSpread({}, options), {}, {
441
+ onSuccess: function onSuccess(result) {
442
+ var _options$onSuccess;
443
+ (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, result);
444
+ queryClient.invalidateQueries(DOMAIN_QUERY_KEY);
445
+ }
446
+ }));
447
+ };
448
+ var useFetchCustomDomains = function useFetchCustomDomains(params) {
449
+ return useQuery([DOMAIN_QUERY_KEY, _objectSpread({}, params)], function () {
450
+ return customDomainApi.fetchCustomDomains(params);
451
+ }, {
452
+ staleTime: DEFAULT_STALE_TIME
453
+ });
454
+ };
455
+ var useValidateDomain = function useValidateDomain(url) {
456
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
457
+ var queryClient = useQueryClient();
458
+ return useMutation(function (id) {
459
+ return customDomainApi.validateDomain(url, id);
460
+ }, _objectSpread(_objectSpread({}, options), {}, {
461
+ onSuccess: function onSuccess() {
462
+ return queryClient.invalidateQueries(DOMAIN_QUERY_KEY);
463
+ }
464
+ }));
465
+ };
466
+ var useValidateCname = function useValidateCname(url) {
467
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
468
+ var queryClient = useQueryClient();
469
+ return useMutation(function (id) {
470
+ return customDomainApi.validateCname(url, id);
471
+ }, _objectSpread(_objectSpread({}, options), {}, {
472
+ onSuccess: function onSuccess() {
473
+ return queryClient.invalidateQueries(DOMAIN_QUERY_KEY);
474
+ }
475
+ }));
476
+ };
477
+ var useUpdateCustomDomain = function useUpdateCustomDomain(url) {
478
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
479
+ var queryClient = useQueryClient();
480
+ return useMutation(function (id) {
481
+ return customDomainApi.updateCustomDomain(url, id);
482
+ }, _objectSpread(_objectSpread({}, options), {}, {
483
+ onSuccess: function onSuccess() {
484
+ return queryClient.invalidateQueries(DOMAIN_QUERY_KEY);
485
+ }
486
+ }));
487
+ };
488
+
489
+ var Manage = function Manage(_ref) {
490
+ var isOpen = _ref.isOpen,
491
+ onClose = _ref.onClose,
492
+ customDomain = _ref.customDomain,
493
+ setCustomDomain = _ref.setCustomDomain,
494
+ url = _ref.url,
495
+ hasOne = _ref.hasOne;
496
+ var _useTranslation = useTranslation(),
497
+ t = _useTranslation.t;
498
+ var initialFocusRef = useRef(null);
499
+ var customDomainId = hasOne ? null : customDomain === null || customDomain === void 0 ? void 0 : customDomain.id;
500
+ var _useCreateCustomDomai = useCreateCustomDomain(url),
501
+ createCustomDomain = _useCreateCustomDomai.mutate,
502
+ isCreating = _useCreateCustomDomai.isLoading;
503
+ var _useValidateDomain = useValidateDomain(url),
504
+ validateDomain = _useValidateDomain.mutate,
505
+ isValidating = _useValidateDomain.isLoading;
506
+ var _useValidateCname = useValidateCname(url),
507
+ validateCname = _useValidateCname.mutate,
508
+ isCnameValidating = _useValidateCname.isLoading;
509
+ var _useUpdateCustomDomai = useUpdateCustomDomain(url),
510
+ updateCustomDomain = _useUpdateCustomDomai.mutate,
511
+ isUpdating = _useUpdateCustomDomai.isLoading;
512
+ var handleSubmit = function handleSubmit(values) {
513
+ return createCustomDomain(values, {
514
+ onSuccess: function onSuccess(values) {
515
+ return setCustomDomain(values);
516
+ }
517
+ });
518
+ };
519
+ var handleValidateDomain = function handleValidateDomain() {
520
+ return validateDomain(customDomainId, {
521
+ onSuccess: function onSuccess(values) {
522
+ return setCustomDomain(values);
523
+ }
524
+ });
525
+ };
526
+ var handleValidateCname = function handleValidateCname() {
527
+ validateCname(customDomainId, {
528
+ onSuccess: function onSuccess(data) {
529
+ return setCustomDomain(data);
530
+ }
531
+ });
532
+ };
533
+ var handleUpdateCname = function handleUpdateCname() {
534
+ updateCustomDomain(customDomainId, {
535
+ onSuccess: function onSuccess(data) {
536
+ return setCustomDomain(data);
537
+ }
538
+ });
539
+ };
540
+ return /*#__PURE__*/React.createElement(Pane, {
541
+ initialFocusRef: initialFocusRef,
542
+ isOpen: isOpen,
543
+ onClose: onClose
544
+ }, /*#__PURE__*/React.createElement(Formik, {
545
+ enableReinitialize: true,
546
+ initialValues: customDomain || INITIAL_VALUES,
547
+ validationSchema: getCustomDomainValidationSchema(),
548
+ onSubmit: handleSubmit
549
+ }, function (_ref2) {
550
+ var dirty = _ref2.dirty;
551
+ return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
552
+ "data-cy": "add-custom-domain-pane-heading",
553
+ style: "h2",
554
+ weight: "semibold"
555
+ }, isNotEmpty(customDomain) ? t("neetoMolecules.customDomain.edit") : t("neetoMolecules.customDomain.addNew"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
556
+ className: "w-full space-y-6"
557
+ }, isNotEmpty(customDomain) && /*#__PURE__*/React.createElement(TagBlock$1, {
558
+ stacked: true,
559
+ handleValidateCname: handleValidateCname,
560
+ isCnameRecordsAdded: customDomain.addedCnameAt,
561
+ status: customDomain.status
562
+ }), /*#__PURE__*/React.createElement("div", {
563
+ className: "space-y-2"
564
+ }, /*#__PURE__*/React.createElement(Label, {
565
+ required: true,
566
+ htmlFor: "hostname"
567
+ }, isNotEmpty(customDomain) ? t("neetoMolecules.customDomain.customDomain", SINGULAR) : t("neetoMolecules.customDomain.label")), /*#__PURE__*/React.createElement("div", {
568
+ className: "flex items-start gap-2"
569
+ }, /*#__PURE__*/React.createElement(Input$1, {
570
+ "data-cy": "custom-domain-input-field",
571
+ disabled: isNotEmpty(customDomain),
572
+ name: "hostname",
573
+ placeholder: t("neetoMolecules.customDomain.placeholder"),
574
+ ref: initialFocusRef
575
+ }), !isNotEmpty(customDomain) && /*#__PURE__*/React.createElement(Button, {
576
+ "data-cy": "submit-custom-domain-button",
577
+ "data-testid": "submit-custom-domain-button",
578
+ disabled: !dirty || isCreating,
579
+ icon: Check,
580
+ loading: isCreating,
581
+ style: "primary",
582
+ type: "submit"
583
+ }))), isNotEmpty(customDomain) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Record$1, {
584
+ customDomain: customDomain
585
+ }), customDomain.status === "pending_domain_validation" && /*#__PURE__*/React.createElement(Button, {
586
+ "data-cy": "validate-domain-button",
587
+ disabled: isValidating,
588
+ loading: isValidating,
589
+ label: t("neetoMolecules.customDomain.validation.buttonLabel.domain"),
590
+ onClick: handleValidateDomain
591
+ }), customDomain.status === "pending_cname_validation" && /*#__PURE__*/React.createElement(Button, {
592
+ "data-cy": "validate-cname-record-button",
593
+ loading: isCnameValidating || isUpdating,
594
+ label: t("neetoMolecules.customDomain.validation.buttonLabel.cnameAdded"),
595
+ onClick: handleUpdateCname
596
+ }), /*#__PURE__*/React.createElement(StatusInfo$1, null)))));
597
+ }));
598
+ };
599
+
600
+ var CustomDomain = function CustomDomain(_ref) {
601
+ var url = _ref.url,
602
+ iconOnly = _ref.iconOnly;
603
+ var _useState = useState(false),
604
+ _useState2 = _slicedToArray(_useState, 2),
605
+ isPaneOpen = _useState2[0],
606
+ setIsPaneOpen = _useState2[1];
607
+ var _useState3 = useState(false),
608
+ _useState4 = _slicedToArray(_useState3, 2),
609
+ isAlertOpen = _useState4[0],
610
+ setIsAlertOpen = _useState4[1];
611
+ var _useTranslation = useTranslation(),
612
+ t = _useTranslation.t;
613
+ var _useFetchCustomDomain = useFetchCustomDomains({
614
+ url: url
615
+ }),
616
+ customDomain = _useFetchCustomDomain.data,
617
+ isLoading = _useFetchCustomDomain.isLoading;
618
+ var _useDeleteCustomDomai = useDeleteCustomDomain(url, {
619
+ onSettled: function onSettled() {
620
+ return setIsAlertOpen(false);
621
+ }
622
+ }),
623
+ deleteCustomDomain = _useDeleteCustomDomai.mutate,
624
+ isDeleting = _useDeleteCustomDomai.isLoading;
625
+ var actions = [{
626
+ key: "edit",
627
+ label: t("neetoMolecules.common.actions.edit"),
628
+ onClick: function onClick() {
629
+ return setIsPaneOpen(true);
630
+ }
631
+ }, {
632
+ key: "delete",
633
+ label: t("neetoMolecules.common.actions.delete"),
634
+ onClick: function onClick() {
635
+ return setIsAlertOpen(true);
636
+ }
637
+ }];
638
+ if (isLoading) return /*#__PURE__*/React.createElement(Spinner, null);
639
+ return /*#__PURE__*/React.createElement("div", null, isNotEmpty(customDomain) ? /*#__PURE__*/React.createElement("div", {
640
+ className: "flex flex-row items-center"
641
+ }, /*#__PURE__*/React.createElement(Tag, {
642
+ label: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
643
+ style: customDomain.status === "active" ? "success" : "warning"
644
+ }), /*#__PURE__*/React.createElement(MoreDropdown, {
645
+ dropdownProps: {
646
+ autoWidth: true
647
+ },
648
+ menuItems: actions,
649
+ dropdownButtonProps: {
650
+ "data-testid": "nui-dropdown-icon",
651
+ strategy: "fixed"
652
+ }
653
+ })) : /*#__PURE__*/React.createElement(Button, {
654
+ icon: iconOnly && CustomDomain$1,
655
+ style: "text",
656
+ label: iconOnly ? "" : t("neetoMolecules.common.actions.add", {
657
+ entity: t("neetoMolecules.customDomain.customDomain", SINGULAR).toLowerCase()
658
+ }),
659
+ tooltipProps: iconOnly && {
660
+ content: t("neetoMolecules.customDomain.customDomain", SINGULAR)
661
+ },
662
+ onClick: function onClick() {
663
+ return setIsPaneOpen(true);
664
+ }
665
+ }), /*#__PURE__*/React.createElement(Manage, {
666
+ hasOne: true,
667
+ customDomain: customDomain,
668
+ url: url,
669
+ isOpen: isPaneOpen,
670
+ setCustomDomain: noop,
671
+ onClose: function onClose() {
672
+ return setIsPaneOpen(false);
673
+ }
674
+ }), /*#__PURE__*/React.createElement(DeleteAlert, {
675
+ hostname: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
676
+ isOpen: isAlertOpen,
677
+ isSubmitting: isDeleting,
678
+ onClose: function onClose() {
679
+ return setIsAlertOpen(false);
680
+ },
681
+ onSubmit: function onSubmit() {
682
+ return deleteCustomDomain();
683
+ }
684
+ }));
685
+ };
686
+
687
+ export { CustomDomain as default };
688
+ //# sourceMappingURL=CustomDomain.js.map