@bigbinary/neeto-molecules 1.1.16 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AutoSaveInput.js +658 -0
- package/dist/AutoSaveInput.js.map +1 -0
- package/dist/Breadcrumbs.js +38 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/BrowserSupport.js +418 -0
- package/dist/BrowserSupport.js.map +1 -0
- package/dist/Builder.js +662 -0
- package/dist/Builder.js.map +1 -0
- package/dist/CalendarView.js +538 -0
- package/dist/CalendarView.js.map +1 -0
- package/dist/Codeblock.js +236 -0
- package/dist/Codeblock.js.map +1 -0
- package/dist/{Columns/index.js → Columns.js} +130 -13
- package/dist/Columns.js.map +1 -0
- package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
- package/dist/ConfirmationModal.js.map +1 -0
- package/dist/Container.js +1211 -0
- package/dist/Container.js.map +1 -0
- package/dist/CopyToClipboardButton.js +209 -0
- package/dist/CopyToClipboardButton.js.map +1 -0
- package/dist/CustomDomain.js +688 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/CustomDomainDashboard.js +2283 -0
- package/dist/CustomDomainDashboard.js.map +1 -0
- package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
- package/dist/DateFormat.js.map +1 -0
- package/dist/DateRangeFilter.js +229 -0
- package/dist/DateRangeFilter.js.map +1 -0
- package/dist/DynamicVariables.js +183 -0
- package/dist/DynamicVariables.js.map +1 -0
- package/dist/EmailForm.js +2292 -0
- package/dist/EmailForm.js.map +1 -0
- package/dist/EmailPreview.js +1353 -0
- package/dist/EmailPreview.js.map +1 -0
- package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Header.js +122 -0
- package/dist/Header.js.map +1 -0
- package/dist/IconPicker.js +313 -0
- package/dist/IconPicker.js.map +1 -0
- package/dist/ImageWithFallback.js +181 -0
- package/dist/ImageWithFallback.js.map +1 -0
- package/dist/IntegrationCard.js +343 -0
- package/dist/IntegrationCard.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.js +80 -0
- package/dist/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
- package/dist/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/IpRestriction.js +857 -0
- package/dist/IpRestriction.js.map +1 -0
- package/dist/KeyboardShortcuts.js +359 -0
- package/dist/KeyboardShortcuts.js.map +1 -0
- package/dist/LoginPage.js +593 -0
- package/dist/LoginPage.js.map +1 -0
- package/dist/MenuBar.js +1461 -0
- package/dist/MenuBar.js.map +1 -0
- package/dist/Metadata.js +206 -0
- package/dist/Metadata.js.map +1 -0
- package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
- package/dist/MoreDropdown.js.map +1 -0
- package/dist/NavigationHeader.js +690 -0
- package/dist/NavigationHeader.js.map +1 -0
- package/dist/NeetoWidget.js +1333 -0
- package/dist/NeetoWidget.js.map +1 -0
- package/dist/PageLoader.js +134 -0
- package/dist/PageLoader.js.map +1 -0
- package/dist/PhoneNumber.js +365 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/PublishBlock.js +158 -0
- package/dist/PublishBlock.js.map +1 -0
- package/dist/Rename.js +450 -0
- package/dist/Rename.js.map +1 -0
- package/dist/ResponsiveDevicePicker.js +194 -0
- package/dist/ResponsiveDevicePicker.js.map +1 -0
- package/dist/Schedule.js +1046 -0
- package/dist/Schedule.js.map +1 -0
- package/dist/Scrollable.js +122 -0
- package/dist/Scrollable.js.map +1 -0
- package/dist/Search.js +151 -0
- package/dist/Search.js.map +1 -0
- package/dist/Security.js +1835 -0
- package/dist/Security.js.map +1 -0
- package/dist/SendToFields.js +601 -0
- package/dist/SendToFields.js.map +1 -0
- package/dist/Settings.js +435 -0
- package/dist/Settings.js.map +1 -0
- package/dist/ShareViaEmail.js +2277 -0
- package/dist/ShareViaEmail.js.map +1 -0
- package/dist/ShareViaLink.js +628 -0
- package/dist/ShareViaLink.js.map +1 -0
- package/dist/Sidebar.js +972 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SubHeader.js +216 -0
- package/dist/SubHeader.js.map +1 -0
- package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
- package/dist/TableWrapper.js.map +1 -0
- package/dist/ThemeSidebar.js +1984 -0
- package/dist/ThemeSidebar.js.map +1 -0
- package/dist/TimeFormat.js +47 -0
- package/dist/TimeFormat.js.map +1 -0
- package/dist/TimezoneMismatchModal.js +168 -0
- package/dist/TimezoneMismatchModal.js.map +1 -0
- package/dist/ToggleFeatureCard.js +323 -0
- package/dist/ToggleFeatureCard.js.map +1 -0
- package/package.json +22 -13
- package/dist/AutoSaveInput/autosaveinput.scss +0 -15
- package/dist/AutoSaveInput/constants.js +0 -13
- package/dist/AutoSaveInput/index.js +0 -124
- package/dist/AutoSaveInput/utils.js +0 -10
- package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
- package/dist/Breadcrumbs/index.js +0 -31
- package/dist/BrowserSupport/Callout.js +0 -15
- package/dist/BrowserSupport/ContactUs.js +0 -21
- package/dist/BrowserSupport/DownloadLink.js +0 -17
- package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
- package/dist/BrowserSupport/UnknownBrowser.js +0 -13
- package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
- package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
- package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
- package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
- package/dist/BrowserSupport/browsersupport.scss +0 -71
- package/dist/BrowserSupport/constants.js +0 -63
- package/dist/BrowserSupport/index.js +0 -58
- package/dist/BrowserSupport/utils.js +0 -32
- package/dist/Builder/Body.js +0 -9
- package/dist/Builder/ElementsPanel/ElementsList/Element.js +0 -27
- package/dist/Builder/ElementsPanel/ElementsList/Section.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/TitleBar.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/index.js +0 -63
- package/dist/Builder/ElementsPanel/SelectedElementsList/SelectedElement.js +0 -73
- package/dist/Builder/ElementsPanel/SelectedElementsList/TitleBar.js +0 -50
- package/dist/Builder/ElementsPanel/SelectedElementsList/index.js +0 -91
- package/dist/Builder/ElementsPanel/index.js +0 -70
- package/dist/Builder/PropertiesPanel/EmptyProperty.js +0 -21
- package/dist/Builder/PropertiesPanel/Skeleton.js +0 -24
- package/dist/Builder/PropertiesPanel/index.js +0 -12
- package/dist/Builder/index.js +0 -3
- package/dist/Builder/styles.scss +0 -84
- package/dist/CalendarView/CustomDatePicker.js +0 -87
- package/dist/CalendarView/Header.js +0 -53
- package/dist/CalendarView/constants.js +0 -19
- package/dist/CalendarView/index.js +0 -83
- package/dist/CalendarView/utils.js +0 -50
- package/dist/Codeblock/index.js +0 -30
- package/dist/Columns/utils.js +0 -20
- package/dist/ConfirmationModal/constants.js +0 -3
- package/dist/ConfirmationModal/utils.js +0 -6
- package/dist/Container/container.scss +0 -21
- package/dist/Container/index.js +0 -23
- package/dist/CopyToClipboardButton/constants.js +0 -13
- package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
- package/dist/CopyToClipboardButton/index.js +0 -59
- package/dist/CustomDomain/index.js +0 -98
- package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
- package/dist/CustomDomainDashboard/Header.js +0 -32
- package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
- package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
- package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
- package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
- package/dist/CustomDomainDashboard/Manage/index.js +0 -125
- package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
- package/dist/CustomDomainDashboard/api.js +0 -35
- package/dist/CustomDomainDashboard/constants.js +0 -2
- package/dist/CustomDomainDashboard/index.js +0 -118
- package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
- package/dist/CustomDomainDashboard/utils.js +0 -84
- package/dist/DateRangeFilter/index.js +0 -60
- package/dist/DateRangeFilter/utils.js +0 -113
- package/dist/DynamicVariables/dynamic-variables.scss +0 -34
- package/dist/DynamicVariables/index.js +0 -59
- package/dist/DynamicVariables/utils.js +0 -37
- package/dist/EmailForm/EmailForm.js +0 -98
- package/dist/EmailForm/EmailFormProvider.js +0 -45
- package/dist/EmailForm/EmailPreview.js +0 -129
- package/dist/EmailForm/ReplyToField.js +0 -55
- package/dist/EmailForm/SendToField.js +0 -28
- package/dist/EmailForm/SubjectField.js +0 -64
- package/dist/EmailForm/constants.js +0 -33
- package/dist/EmailForm/contexts/EmailForm.js +0 -7
- package/dist/EmailForm/index.js +0 -4
- package/dist/EmailForm/utils.js +0 -10
- package/dist/EmailPreview/index.js +0 -2
- package/dist/ErrorPage/index.js +0 -78
- package/dist/Header/Breadcrumbs.js +0 -31
- package/dist/Header/Dropdown.js +0 -12
- package/dist/Header/constants.js +0 -6
- package/dist/Header/header.scss +0 -121
- package/dist/Header/index.js +0 -61
- package/dist/IconPicker/Icon.js +0 -34
- package/dist/IconPicker/NoResults.js +0 -12
- package/dist/IconPicker/constants.js +0 -8
- package/dist/IconPicker/icon-picker.scss +0 -1
- package/dist/IconPicker/index.js +0 -164
- package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
- package/dist/ImageWithFallback/index.js +0 -31
- package/dist/IntegrationCard/Dropdown.js +0 -45
- package/dist/IntegrationCard/Status.js +0 -25
- package/dist/IntegrationCard/index.js +0 -128
- package/dist/IntegrationDisconnectAlert/index.js +0 -36
- package/dist/IpRestriction/AllowedIpRanges.js +0 -75
- package/dist/IpRestriction/CurrentIp.js +0 -26
- package/dist/IpRestriction/FormRow.js +0 -84
- package/dist/IpRestriction/Row.js +0 -91
- package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
- package/dist/IpRestriction/apis/current_ip.js +0 -11
- package/dist/IpRestriction/apis/ip_restriction.js +0 -16
- package/dist/IpRestriction/constants.js +0 -20
- package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
- package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
- package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
- package/dist/IpRestriction/index.js +0 -102
- package/dist/IpRestriction/utils.js +0 -85
- package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
- package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
- package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
- package/dist/KeyboardShortcuts/Pane/index.js +0 -61
- package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
- package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
- package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
- package/dist/KeyboardShortcuts/index.js +0 -9
- package/dist/LoginPage/Form.js +0 -57
- package/dist/LoginPage/constants.js +0 -12
- package/dist/LoginPage/index.js +0 -103
- package/dist/MenuBar/AddNew.js +0 -25
- package/dist/MenuBar/Block.js +0 -60
- package/dist/MenuBar/Item.js +0 -32
- package/dist/MenuBar/Search.js +0 -39
- package/dist/MenuBar/SubTitle.js +0 -23
- package/dist/MenuBar/index.js +0 -46
- package/dist/MenuBar/menubar.scss +0 -154
- package/dist/Metadata/Block.js +0 -30
- package/dist/Metadata/DetailsBlock.js +0 -86
- package/dist/Metadata/constants.js +0 -9
- package/dist/Metadata/index.js +0 -29
- package/dist/Metadata/metadata.scss +0 -15
- package/dist/MoreDropdown/constants.js +0 -25
- package/dist/NavigationHeader/LeftBlock.js +0 -32
- package/dist/NavigationHeader/Navigation.js +0 -24
- package/dist/NavigationHeader/RightBlock.js +0 -68
- package/dist/NavigationHeader/constants.js +0 -11
- package/dist/NavigationHeader/index.js +0 -19
- package/dist/NavigationHeader/navigation-header.scss +0 -3
- package/dist/NeetoWidget/CodeBlock.js +0 -57
- package/dist/NeetoWidget/CodeSnippet.js +0 -119
- package/dist/NeetoWidget/EmbedCode.js +0 -281
- package/dist/NeetoWidget/Main.js +0 -19
- package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
- package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
- package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
- package/dist/NeetoWidget/api.js +0 -20
- package/dist/NeetoWidget/constants.js +0 -62
- package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
- package/dist/NeetoWidget/index.js +0 -7
- package/dist/NeetoWidget/mutations.js +0 -9
- package/dist/NeetoWidget/queries.js +0 -32
- package/dist/NeetoWidget/utils.js +0 -83
- package/dist/PageLoader/index.js +0 -81
- package/dist/PageLoader/page-loader.scss +0 -95
- package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
- package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
- package/dist/PhoneNumber/CountryPicker/index.js +0 -59
- package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
- package/dist/PhoneNumber/PhoneNumber.js +0 -30
- package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
- package/dist/PhoneNumber/index.js +0 -5
- package/dist/PhoneNumber/utils.js +0 -55
- package/dist/PublishBlock/AlertBlock.js +0 -14
- package/dist/PublishBlock/index.js +0 -100
- package/dist/PublishBlock/publish-block.scss +0 -25
- package/dist/Rename/DummySpan.js +0 -21
- package/dist/Rename/constants.js +0 -1
- package/dist/Rename/index.js +0 -191
- package/dist/Rename/rename.scss +0 -69
- package/dist/Rename/utils.js +0 -10
- package/dist/ResponsiveDevicePicker/constants.js +0 -19
- package/dist/ResponsiveDevicePicker/index.js +0 -36
- package/dist/Schedule/DisplayAvailability.js +0 -58
- package/dist/Schedule/Fields.js +0 -43
- package/dist/Schedule/Form/ScheduleRow.js +0 -125
- package/dist/Schedule/Form/constants.js +0 -20
- package/dist/Schedule/Form/index.js +0 -144
- package/dist/Schedule/Form/utils.js +0 -63
- package/dist/Schedule/Header.js +0 -76
- package/dist/Schedule/ScheduleContext.js +0 -8
- package/dist/Schedule/constants.js +0 -8
- package/dist/Schedule/dayjsExtended/constants.js +0 -1
- package/dist/Schedule/dayjsExtended/index.js +0 -14
- package/dist/Schedule/dayjsExtended/range.js +0 -73
- package/dist/Schedule/index.js +0 -80
- package/dist/Schedule/utils.js +0 -152
- package/dist/Scrollable/constants.js +0 -8
- package/dist/Scrollable/index.js +0 -26
- package/dist/Scrollable/scrollable.scss +0 -32
- package/dist/Search/index.js +0 -52
- package/dist/Security/AllowedKeywords/Add.js +0 -38
- package/dist/Security/AllowedKeywords/index.js +0 -38
- package/dist/Security/PasswordBlock.js +0 -31
- package/dist/Security/RadioBlock.js +0 -38
- package/dist/Security/api.js +0 -12
- package/dist/Security/constants.js +0 -58
- package/dist/Security/index.js +0 -68
- package/dist/Security/useSecurityApi.js +0 -22
- package/dist/Security/utils.js +0 -31
- package/dist/SendToFields/FilePicker.js +0 -34
- package/dist/SendToFields/constants.js +0 -6
- package/dist/SendToFields/index.js +0 -102
- package/dist/SendToFields/utils.js +0 -54
- package/dist/Settings/Category.js +0 -30
- package/dist/Settings/Item.js +0 -38
- package/dist/Settings/index.js +0 -37
- package/dist/Settings/utils.js +0 -4
- package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
- package/dist/ShareViaEmail/FilePicker.js +0 -43
- package/dist/ShareViaEmail/Form.js +0 -105
- package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
- package/dist/ShareViaEmail/constants.js +0 -14
- package/dist/ShareViaEmail/index.js +0 -92
- package/dist/ShareViaEmail/utils.js +0 -72
- package/dist/ShareViaLink/EditURL.js +0 -74
- package/dist/ShareViaLink/Link.js +0 -105
- package/dist/ShareViaLink/QRCode.js +0 -41
- package/dist/ShareViaLink/RegenerateURL.js +0 -47
- package/dist/ShareViaLink/SocialMedia.js +0 -52
- package/dist/ShareViaLink/constants.js +0 -25
- package/dist/ShareViaLink/edit-url.scss +0 -8
- package/dist/ShareViaLink/index.js +0 -46
- package/dist/ShareViaLink/utils.js +0 -47
- package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
- package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
- package/dist/Sidebar/AppSwitcher/Body.js +0 -65
- package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
- package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
- package/dist/Sidebar/AppSwitcher/index.js +0 -47
- package/dist/Sidebar/AppSwitcher/utils.js +0 -25
- package/dist/Sidebar/Chevron.js +0 -14
- package/dist/Sidebar/FeaturedTooltip.js +0 -19
- package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
- package/dist/Sidebar/Footer/ProfileButton.js +0 -30
- package/dist/Sidebar/Footer/index.js +0 -56
- package/dist/Sidebar/Footer/utils.js +0 -39
- package/dist/Sidebar/Header.js +0 -33
- package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
- package/dist/Sidebar/HelpSection/index.js +0 -32
- package/dist/Sidebar/Links.js +0 -112
- package/dist/Sidebar/NavIconWrapper.js +0 -20
- package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
- package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
- package/dist/Sidebar/ProfileSection/index.js +0 -42
- package/dist/Sidebar/constants.js +0 -40
- package/dist/Sidebar/index.js +0 -94
- package/dist/Sidebar/sidebar.scss +0 -379
- package/dist/Sidebar/utils.js +0 -18
- package/dist/SubHeader/RightBlock/Columns.js +0 -35
- package/dist/SubHeader/RightBlock/Download.js +0 -28
- package/dist/SubHeader/RightBlock/Filter.js +0 -31
- package/dist/SubHeader/RightBlock/index.js +0 -21
- package/dist/SubHeader/RightBlock/utils.js +0 -13
- package/dist/SubHeader/index.js +0 -28
- package/dist/SubHeader/subheader.scss +0 -78
- package/dist/ThemeSidebar/Customize/Logo.js +0 -39
- package/dist/ThemeSidebar/Customize/Properties.js +0 -170
- package/dist/ThemeSidebar/Customize/index.js +0 -66
- package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
- package/dist/ThemeSidebar/Themes/index.js +0 -110
- package/dist/ThemeSidebar/TitleBar.js +0 -62
- package/dist/ThemeSidebar/constants.js +0 -127
- package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
- package/dist/ThemeSidebar/fields/Card.js +0 -19
- package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
- package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
- package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
- package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
- package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
- package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
- package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
- package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
- package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
- package/dist/ThemeSidebar/fields/slider.scss +0 -199
- package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
- package/dist/ThemeSidebar/index.js +0 -118
- package/dist/ThemeSidebar/themeSidebar.scss +0 -45
- package/dist/ThemeSidebar/utils.js +0 -169
- package/dist/TimeFormat/index.js +0 -3
- package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
- package/dist/TimezoneMismatchModal/index.js +0 -83
- package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
- package/dist/TimezoneMismatchModal/utils.js +0 -12
- package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
- package/dist/ToggleFeatureCard/constants.js +0 -5
- package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
- package/dist/ToggleFeatureCard/index.js +0 -148
- package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import i18next from "i18next";
|
|
2
|
-
import { capitalize } from "@bigbinary/neeto-commons-frontend/pure";
|
|
3
|
-
import { identity, last } from "ramda";
|
|
4
|
-
import * as yup from "yup";
|
|
5
|
-
import { NEETO_WIDGET_USER_IDENTITY_KEY, SESSION_CONTEXT_KEY, RAILS_ENV, NEETO_WIDGET_SCRIPT_URL, SAMPLE_USER_IDENTITY_CODE_STRING } from "./constants";
|
|
6
|
-
var buildEmbedWidgetScript = function buildEmbedWidgetScript() {
|
|
7
|
-
var widgetScriptUrl = window.globalProps.railsEnv === RAILS_ENV.production ? NEETO_WIDGET_SCRIPT_URL.production : NEETO_WIDGET_SCRIPT_URL.staging;
|
|
8
|
-
return "<script src=\"".concat(widgetScriptUrl, "\"></script>");
|
|
9
|
-
};
|
|
10
|
-
var indentAndFormat = function indentAndFormat(str) {
|
|
11
|
-
var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
12
|
-
return str.split("\n").map(formatter).join("\n ");
|
|
13
|
-
};
|
|
14
|
-
var getCommentedCommand = function getCommentedCommand(command, isEnabled) {
|
|
15
|
-
return isEnabled ? command : "/// ".concat(command);
|
|
16
|
-
};
|
|
17
|
-
var embedWidgetEnvironment = function embedWidgetEnvironment() {
|
|
18
|
-
switch (window.globalProps.railsEnv) {
|
|
19
|
-
case RAILS_ENV.production:
|
|
20
|
-
return "";
|
|
21
|
-
case RAILS_ENV.development:
|
|
22
|
-
return "environment: \"".concat(RAILS_ENV.development, "\",");
|
|
23
|
-
case RAILS_ENV.staging:
|
|
24
|
-
return "environment: \"".concat(RAILS_ENV.staging, "\",");
|
|
25
|
-
default:
|
|
26
|
-
return "/* Unidentified RAILS_ENV, */";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var embedWidgetApiKey = function embedWidgetApiKey(apiKey) {
|
|
30
|
-
return "apiKey: \"".concat(apiKey, "\",");
|
|
31
|
-
};
|
|
32
|
-
var addChangelogOptions = function addChangelogOptions() {
|
|
33
|
-
return "neetoChangelogOptions: {\n elementId: \"neetochangelog-trigger\",\n},";
|
|
34
|
-
};
|
|
35
|
-
var wrapBlockInOnLoad = function wrapBlockInOnLoad(codeBlock) {
|
|
36
|
-
return "window.addEventListener(\"load\", () => ".concat(codeBlock, ");");
|
|
37
|
-
};
|
|
38
|
-
var embedWidgetFunctionCall = function embedWidgetFunctionCall(enabledWidgets, apiKey) {
|
|
39
|
-
return "embedNeetoWidget({\n ".concat(embedWidgetEnvironment(), "\n ").concat(indentAndFormat(embedWidgetApiKey(apiKey)), "\n ").concat(indentAndFormat(addChangelogOptions(), function (cmd) {
|
|
40
|
-
return getCommentedCommand(cmd, enabledWidgets.changelog);
|
|
41
|
-
}), "\n})");
|
|
42
|
-
};
|
|
43
|
-
var filterMarkedCommands = function filterMarkedCommands(queryString) {
|
|
44
|
-
return queryString.split("\n").filter(function (line) {
|
|
45
|
-
return !line.includes("///") && line.trim();
|
|
46
|
-
}).join("\n");
|
|
47
|
-
};
|
|
48
|
-
export var getSampleUserIdentity = function getSampleUserIdentity(enabledWidgets, selectedFramework) {
|
|
49
|
-
var splitCodeLines = SAMPLE_USER_IDENTITY_CODE_STRING[selectedFramework].split("\n");
|
|
50
|
-
return filterMarkedCommands(splitCodeLines.map(function (cmd) {
|
|
51
|
-
var isEmailKey = cmd.includes("email");
|
|
52
|
-
var isObjectStartLine = cmd === splitCodeLines[0];
|
|
53
|
-
var isObjectEndLine = cmd === last(splitCodeLines);
|
|
54
|
-
var isLineHidden = !isEmailKey && !isObjectStartLine && !isObjectEndLine;
|
|
55
|
-
if (!enabledWidgets.chat && isLineHidden || !enabledWidgets.chat && !enabledWidgets.replay) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
return cmd;
|
|
59
|
-
}).join("\n"));
|
|
60
|
-
};
|
|
61
|
-
export var sampleConsolidatedCodeString = function sampleConsolidatedCodeString(enabledWidgets, apiKey) {
|
|
62
|
-
return filterMarkedCommands("".concat(buildEmbedWidgetScript(), "\n<script>\n ").concat(enabledWidgets.chat || enabledWidgets.replay ? "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {};") : "", "\n ").concat(enabledWidgets.replay ? "window.".concat(SESSION_CONTEXT_KEY, " = {};") : "", "\n\n ").concat(indentAndFormat(wrapBlockInOnLoad(embedWidgetFunctionCall(enabledWidgets, apiKey))), "\n</script>"));
|
|
63
|
-
};
|
|
64
|
-
export var getEmailWidgetSnippetFormInitialValues = function getEmailWidgetSnippetFormInitialValues(subject) {
|
|
65
|
-
return {
|
|
66
|
-
emails: "",
|
|
67
|
-
subject: subject
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export var getSortedPrefixedWidgets = function getSortedPrefixedWidgets(widgets) {
|
|
71
|
-
return widgets.sort().map(function (widget) {
|
|
72
|
-
return "neeto".concat(capitalize(widget));
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
export var getEmailWidgetSnippetValidationSchema = function getEmailWidgetSnippetValidationSchema() {
|
|
76
|
-
return yup.object({
|
|
77
|
-
emails: yup.array().required().label(i18next.t("neetoMolecules.widget.email.fields.emails.label")),
|
|
78
|
-
subject: yup.string().required().label(i18next.t("neetoMolecules.widget.email.fields.subject.label"))
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
export var getWidgetApiKeyUrl = function getWidgetApiKeyUrl() {
|
|
82
|
-
return "api/widget/v1/api_keys/".concat(window.globalProps.organization.subdomain);
|
|
83
|
-
};
|
package/dist/PageLoader/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["text"];
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Typography } from "@bigbinary/neetoui";
|
|
6
|
-
var Neeto = function Neeto(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
8
|
-
d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
|
|
9
|
-
fill: "#0043AC"
|
|
10
|
-
}), /*#__PURE__*/React.createElement("mask", {
|
|
11
|
-
id: "a",
|
|
12
|
-
style: {
|
|
13
|
-
maskType: "alpha"
|
|
14
|
-
},
|
|
15
|
-
maskUnits: "userSpaceOnUse",
|
|
16
|
-
x: "0",
|
|
17
|
-
y: "0",
|
|
18
|
-
width: "415",
|
|
19
|
-
height: "415"
|
|
20
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
21
|
-
d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
|
|
22
|
-
fill: "#0043AC"
|
|
23
|
-
})), /*#__PURE__*/React.createElement("g", {
|
|
24
|
-
mask: "url(#a)"
|
|
25
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
26
|
-
d: "M233.747 348.74c88.579 101.145 172.015 116.411 202.661 111.401v32.491H-8.032V230.487c43.685-2.726 153.2 17.108 241.779 118.253Z",
|
|
27
|
-
fill: "url(#b)"
|
|
28
|
-
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
|
|
29
|
-
id: "b",
|
|
30
|
-
cx: "0",
|
|
31
|
-
cy: "0",
|
|
32
|
-
r: "1",
|
|
33
|
-
gradientUnits: "userSpaceOnUse",
|
|
34
|
-
gradientTransform: "rotate(47.118 -220.556 214.818) scale(427.964 725.049)"
|
|
35
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
36
|
-
stopColor: "#0043AC"
|
|
37
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
38
|
-
offset: "1",
|
|
39
|
-
stopColor: "#3DB1CA",
|
|
40
|
-
stopOpacity: ".8"
|
|
41
|
-
}))));
|
|
42
|
-
};
|
|
43
|
-
Neeto.defaultProps = {
|
|
44
|
-
width: "50",
|
|
45
|
-
height: "50",
|
|
46
|
-
viewBox: "0 0 415 415",
|
|
47
|
-
fill: "none",
|
|
48
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
49
|
-
};
|
|
50
|
-
import "./page-loader.scss";
|
|
51
|
-
var PageLoader = function PageLoader(_ref) {
|
|
52
|
-
var _ref$text = _ref.text,
|
|
53
|
-
text = _ref$text === void 0 ? "" : _ref$text,
|
|
54
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
55
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
56
|
-
className: "neeto-molecules-pageloader__wrapper"
|
|
57
|
-
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "neeto-molecules-pageloader neeto-ui-flex neeto-ui-flex-col neeto-ui-items-center neeto-ui-justify-center"
|
|
59
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: "neeto-molecules-pageloader__content neeto-ui-flex neeto-ui-flex-shrink-0 neeto-ui-items-center neeto-ui-justify-center"
|
|
61
|
-
}, /*#__PURE__*/React.createElement(Neeto, {
|
|
62
|
-
className: "neeto-molecules-pageloader__logo",
|
|
63
|
-
size: 50
|
|
64
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: "neeto-molecules-pageloader__spinner"
|
|
66
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: "neeto-molecules-pageloader__rect1"
|
|
68
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
className: "neeto-molecules-pageloader__rect2"
|
|
70
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "neeto-molecules-pageloader__rect3"
|
|
72
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: "neeto-molecules-pageloader__rect4"
|
|
74
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "neeto-molecules-pageloader__rect5"
|
|
76
|
-
}))), text && /*#__PURE__*/React.createElement(Typography, {
|
|
77
|
-
style: "h5",
|
|
78
|
-
weight: "semibold"
|
|
79
|
-
}, text)));
|
|
80
|
-
};
|
|
81
|
-
export default /*#__PURE__*/React.memo(PageLoader);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.neeto-molecules-pageloader__wrapper {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
|
|
6
|
-
.neeto-molecules-pageloader {
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.neeto-molecules-pageloader__content {
|
|
15
|
-
position: relative;
|
|
16
|
-
padding: 8px;
|
|
17
|
-
margin-bottom: 16px;
|
|
18
|
-
width: 66px;
|
|
19
|
-
height: 66px;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.neeto-molecules-pageloader__text {
|
|
24
|
-
margin-bottom: 4rem;
|
|
25
|
-
text-align: center;
|
|
26
|
-
font-size: 1.25rem;
|
|
27
|
-
line-height: 1.75rem;
|
|
28
|
-
color: rgb(var(--neeto-ui-gray-800));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.neeto-molecules-pageloader__spinner {
|
|
33
|
-
height: 25px;
|
|
34
|
-
display: flex;
|
|
35
|
-
gap: 2px;
|
|
36
|
-
position: absolute;
|
|
37
|
-
left: 50%;
|
|
38
|
-
top: 50%;
|
|
39
|
-
transform: translate(-50%, -50%);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.neeto-molecules-pageloader__spinner > div {
|
|
43
|
-
background-color: #fff;
|
|
44
|
-
height: 100%;
|
|
45
|
-
width: 2px;
|
|
46
|
-
border-radius: 2px;
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
|
|
49
|
-
-webkit-animation: neeto-ui-stretch-delay 1.2s infinite ease-in-out;
|
|
50
|
-
animation: neeto-ui-stretch-delay 1.2s infinite ease-in-out;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect2 {
|
|
54
|
-
-webkit-animation-delay: -1.1s;
|
|
55
|
-
animation-delay: -1.1s;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect3 {
|
|
59
|
-
-webkit-animation-delay: -1s;
|
|
60
|
-
animation-delay: -1s;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect4 {
|
|
64
|
-
-webkit-animation-delay: -0.9s;
|
|
65
|
-
animation-delay: -0.9s;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect5 {
|
|
69
|
-
-webkit-animation-delay: -0.8s;
|
|
70
|
-
animation-delay: -0.8s;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@-webkit-keyframes neeto-ui-stretch-delay {
|
|
74
|
-
0%,
|
|
75
|
-
40%,
|
|
76
|
-
100% {
|
|
77
|
-
-webkit-transform: scaleY(0.4);
|
|
78
|
-
}
|
|
79
|
-
20% {
|
|
80
|
-
-webkit-transform: scaleY(1);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes neeto-ui-stretch-delay {
|
|
85
|
-
0%,
|
|
86
|
-
40%,
|
|
87
|
-
100% {
|
|
88
|
-
transform: scaleY(0.4);
|
|
89
|
-
-webkit-transform: scaleY(0.4);
|
|
90
|
-
}
|
|
91
|
-
20% {
|
|
92
|
-
transform: scaleY(1);
|
|
93
|
-
-webkit-transform: scaleY(1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["country", "showEmoji"];
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { countries } from "countries-list";
|
|
6
|
-
import { Tooltip, Typography } from "@bigbinary/neetoui";
|
|
7
|
-
var SingleValue = function SingleValue(_ref) {
|
|
8
|
-
var country = _ref.country,
|
|
9
|
-
_ref$showEmoji = _ref.showEmoji,
|
|
10
|
-
showEmoji = _ref$showEmoji === void 0 ? false : _ref$showEmoji,
|
|
11
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
if (!showEmoji) return null;
|
|
13
|
-
var countryData = countries[country];
|
|
14
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
15
|
-
content: countryData.name
|
|
16
|
-
}, /*#__PURE__*/React.createElement(Typography, _extends({
|
|
17
|
-
className: "cursor-pointer text-center text-xl",
|
|
18
|
-
style: "body2"
|
|
19
|
-
}, otherProps), countryData.emoji));
|
|
20
|
-
};
|
|
21
|
-
export default /*#__PURE__*/React.memo(SingleValue);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { countries } from "countries-list";
|
|
3
|
-
import { mergeLeft, assoc } from "ramda";
|
|
4
|
-
export var COUNTRY_PICKER_OPTIONS = Object.entries(countries).map(function (_ref) {
|
|
5
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
6
|
-
code = _ref2[0],
|
|
7
|
-
country = _ref2[1];
|
|
8
|
-
return {
|
|
9
|
-
label: country.name,
|
|
10
|
-
value: code
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
export var COUNTRY_PICKER_STYLES = {
|
|
14
|
-
menuPortal: mergeLeft({
|
|
15
|
-
width: 196,
|
|
16
|
-
zIndex: 99999
|
|
17
|
-
}),
|
|
18
|
-
control: mergeLeft({
|
|
19
|
-
border: "none !important",
|
|
20
|
-
cursor: "pointer",
|
|
21
|
-
gap: 4
|
|
22
|
-
}),
|
|
23
|
-
input: assoc("position", "absolute !important"),
|
|
24
|
-
valueContainer: assoc("padding", "0 !important"),
|
|
25
|
-
indicatorsContainer: assoc("paddingRight", "0 !important")
|
|
26
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["country", "setCountry", "onInputChange", "prefix", "phoneNumber"];
|
|
5
|
-
import React, { useState } from "react";
|
|
6
|
-
import classnames from "classnames";
|
|
7
|
-
import { getCountryCallingCode } from "libphonenumber-js/min";
|
|
8
|
-
import { Select } from "@bigbinary/neetoui";
|
|
9
|
-
import { COUNTRY_PICKER_OPTIONS, COUNTRY_PICKER_STYLES } from "./constants";
|
|
10
|
-
import _SingleValue from "./SingleValue";
|
|
11
|
-
var CountryPicker = function CountryPicker(_ref) {
|
|
12
|
-
var country = _ref.country,
|
|
13
|
-
setCountry = _ref.setCountry,
|
|
14
|
-
onInputChange = _ref.onInputChange,
|
|
15
|
-
prefix = _ref.prefix,
|
|
16
|
-
phoneNumber = _ref.phoneNumber,
|
|
17
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
var _useState = useState(""),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
searchTerm = _useState2[0],
|
|
21
|
-
setSearchTerm = _useState2[1];
|
|
22
|
-
var handleCountryChange = function handleCountryChange(_ref2) {
|
|
23
|
-
var value = _ref2.value;
|
|
24
|
-
setCountry(value);
|
|
25
|
-
onInputChange(phoneNumber.replace(prefix, "+".concat(getCountryCallingCode(value))));
|
|
26
|
-
};
|
|
27
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: classnames("flex-shrink-0", {
|
|
29
|
-
"w-10": !searchTerm,
|
|
30
|
-
"w-24": searchTerm
|
|
31
|
-
})
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
33
|
-
isSearchable: true,
|
|
34
|
-
"data-testid": "phonenumber-country-picker",
|
|
35
|
-
options: COUNTRY_PICKER_OPTIONS,
|
|
36
|
-
strategy: "fixed",
|
|
37
|
-
styles: COUNTRY_PICKER_STYLES,
|
|
38
|
-
value: {
|
|
39
|
-
value: country
|
|
40
|
-
},
|
|
41
|
-
components: {
|
|
42
|
-
SingleValue: function SingleValue() {
|
|
43
|
-
return /*#__PURE__*/React.createElement(_SingleValue, {
|
|
44
|
-
showEmoji: true,
|
|
45
|
-
country: country
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
isOptionSelected: function isOptionSelected(_ref3, _ref4) {
|
|
50
|
-
var value = _ref3.value;
|
|
51
|
-
var _ref5 = _slicedToArray(_ref4, 1),
|
|
52
|
-
selectedOption = _ref5[0];
|
|
53
|
-
return (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.name) === value;
|
|
54
|
-
},
|
|
55
|
-
onChange: handleCountryChange,
|
|
56
|
-
onInputChange: setSearchTerm
|
|
57
|
-
}, otherProps)));
|
|
58
|
-
};
|
|
59
|
-
export default /*#__PURE__*/React.memo(CountryPicker);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["name"];
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { useField } from "formik";
|
|
7
|
-
import PhoneNumberInput from "./PhoneNumberInput";
|
|
8
|
-
var FormikPhoneNumberInput = function FormikPhoneNumberInput(_ref) {
|
|
9
|
-
var name = _ref.name,
|
|
10
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
-
var _useField = useField(name),
|
|
12
|
-
_useField2 = _slicedToArray(_useField, 3),
|
|
13
|
-
field = _useField2[0],
|
|
14
|
-
meta = _useField2[1],
|
|
15
|
-
setValue = _useField2[2].setValue;
|
|
16
|
-
return /*#__PURE__*/React.createElement(PhoneNumberInput, _extends({}, field, {
|
|
17
|
-
error: meta.touched ? meta.error : "",
|
|
18
|
-
onChange: setValue
|
|
19
|
-
}, props));
|
|
20
|
-
};
|
|
21
|
-
export default FormikPhoneNumberInput;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "defaultCountry", "value", "showEmoji", "children"];
|
|
4
|
-
import React from "react";
|
|
5
|
-
import classnames from "classnames";
|
|
6
|
-
import { Typography } from "@bigbinary/neetoui";
|
|
7
|
-
import SingleValue from "./CountryPicker/SingleValue";
|
|
8
|
-
import { getPhoneData } from "./utils";
|
|
9
|
-
var PhoneNumber = function PhoneNumber(_ref) {
|
|
10
|
-
var className = _ref.className,
|
|
11
|
-
_ref$defaultCountry = _ref.defaultCountry,
|
|
12
|
-
defaultCountry = _ref$defaultCountry === void 0 ? "IN" : _ref$defaultCountry,
|
|
13
|
-
value = _ref.value,
|
|
14
|
-
_ref$showEmoji = _ref.showEmoji,
|
|
15
|
-
showEmoji = _ref$showEmoji === void 0 ? false : _ref$showEmoji,
|
|
16
|
-
children = _ref.children,
|
|
17
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
var _getPhoneData = getPhoneData(value || children, defaultCountry),
|
|
19
|
-
international = _getPhoneData.international,
|
|
20
|
-
country = _getPhoneData.country;
|
|
21
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className: classnames(["flex items-center space-x-2", className])
|
|
23
|
-
}, /*#__PURE__*/React.createElement(SingleValue, _extends({
|
|
24
|
-
country: country,
|
|
25
|
-
showEmoji: showEmoji
|
|
26
|
-
}, otherProps)), /*#__PURE__*/React.createElement(Typography, _extends({
|
|
27
|
-
style: "body2"
|
|
28
|
-
}, otherProps), international));
|
|
29
|
-
};
|
|
30
|
-
export default /*#__PURE__*/React.memo(PhoneNumber);
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["value", "onChange", "className", "error", "defaultCountry", "selectProps"];
|
|
5
|
-
import React, { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
-
import classnames from "classnames";
|
|
7
|
-
import { formatIncompletePhoneNumber, getCountryCallingCode } from "libphonenumber-js/min";
|
|
8
|
-
import { noop } from "@bigbinary/neeto-commons-frontend/pure";
|
|
9
|
-
import { Input } from "@bigbinary/neetoui";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import CountryPicker from "./CountryPicker";
|
|
12
|
-
import { getCursorPosition, getPhoneData } from "./utils";
|
|
13
|
-
var PhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
|
-
var _ref$value = _ref.value,
|
|
15
|
-
value = _ref$value === void 0 ? "" : _ref$value,
|
|
16
|
-
_ref$onChange = _ref.onChange,
|
|
17
|
-
onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
|
|
18
|
-
className = _ref.className,
|
|
19
|
-
error = _ref.error,
|
|
20
|
-
_ref$defaultCountry = _ref.defaultCountry,
|
|
21
|
-
defaultCountry = _ref$defaultCountry === void 0 ? "IN" : _ref$defaultCountry,
|
|
22
|
-
selectProps = _ref.selectProps,
|
|
23
|
-
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
var _useTranslation = useTranslation(),
|
|
25
|
-
t = _useTranslation.t;
|
|
26
|
-
var internalValue = useRef(value);
|
|
27
|
-
var _useState = useState(defaultCountry),
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
country = _useState2[0],
|
|
30
|
-
setCountry = _useState2[1];
|
|
31
|
-
var prefix = country ? "+".concat(getCountryCallingCode(country)) : "";
|
|
32
|
-
var formattedValue = formatIncompletePhoneNumber(value, country);
|
|
33
|
-
var handleInputChange = useCallback(function (value) {
|
|
34
|
-
onChange(value);
|
|
35
|
-
internalValue.current = value;
|
|
36
|
-
}, []);
|
|
37
|
-
var handleChange = function handleChange(event) {
|
|
38
|
-
var _getPhoneData = getPhoneData(event.target.value, country),
|
|
39
|
-
phoneNumber = _getPhoneData.phoneNumber,
|
|
40
|
-
newCountry = _getPhoneData.country;
|
|
41
|
-
handleInputChange(phoneNumber);
|
|
42
|
-
setCountry(newCountry);
|
|
43
|
-
var cursor = getCursorPosition({
|
|
44
|
-
event: event,
|
|
45
|
-
prevFormattedValue: formattedValue,
|
|
46
|
-
newFormattedValue: formatIncompletePhoneNumber(phoneNumber, newCountry)
|
|
47
|
-
});
|
|
48
|
-
window.requestAnimationFrame(function () {
|
|
49
|
-
return event.target.setSelectionRange(cursor, cursor);
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
if (internalValue.current !== value) {
|
|
54
|
-
setCountry(getPhoneData(value, defaultCountry).country);
|
|
55
|
-
}
|
|
56
|
-
}, [value]);
|
|
57
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: classnames([className])
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Input, _extends({
|
|
60
|
-
"data-testid": "phonenumber-input",
|
|
61
|
-
error: error,
|
|
62
|
-
ref: ref,
|
|
63
|
-
type: "tel",
|
|
64
|
-
value: formattedValue,
|
|
65
|
-
placeholder: t("neetoMolecules.phoneNumberInput.placeholder", {
|
|
66
|
-
prefix: prefix
|
|
67
|
-
}),
|
|
68
|
-
prefix: /*#__PURE__*/React.createElement(CountryPicker, _extends({
|
|
69
|
-
country: country,
|
|
70
|
-
phoneNumber: value,
|
|
71
|
-
prefix: prefix,
|
|
72
|
-
setCountry: setCountry,
|
|
73
|
-
onInputChange: handleInputChange
|
|
74
|
-
}, selectProps)),
|
|
75
|
-
onChange: handleChange
|
|
76
|
-
}, inputProps)));
|
|
77
|
-
});
|
|
78
|
-
PhoneNumberInput.displayName = "PhoneNumberInput";
|
|
79
|
-
export default PhoneNumberInput;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import FormikPhoneNumberInput from "./FormikPhoneNumberInput";
|
|
2
|
-
import PhoneNumber from "./PhoneNumber";
|
|
3
|
-
import PhoneNumberInput from "./PhoneNumberInput";
|
|
4
|
-
import { isPhoneNumberValid, validation } from "./utils";
|
|
5
|
-
export { PhoneNumber, PhoneNumberInput, FormikPhoneNumberInput, isPhoneNumberValid, validation };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import i18next from "i18next";
|
|
2
|
-
import { formatIncompletePhoneNumber, isValidPhoneNumber, parsePhoneNumber } from "libphonenumber-js/min";
|
|
3
|
-
import * as yup from "yup";
|
|
4
|
-
export var isPhoneNumberValid = function isPhoneNumberValid() {
|
|
5
|
-
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
6
|
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
7
|
-
rest[_key - 1] = arguments[_key];
|
|
8
|
-
}
|
|
9
|
-
return isValidPhoneNumber.apply(void 0, [value].concat(rest));
|
|
10
|
-
};
|
|
11
|
-
export var validation = function validation() {
|
|
12
|
-
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : i18next.t("neetoMolecules.phoneNumberInput.validations.invalid");
|
|
13
|
-
return yup.string().test("phoneNumber", message, function (phoneNumber) {
|
|
14
|
-
return phoneNumber ? isValidPhoneNumber(phoneNumber) : true;
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export var getPhoneData = function getPhoneData(value, defaultCountry) {
|
|
18
|
-
try {
|
|
19
|
-
var parsedValue = parsePhoneNumber(value, defaultCountry);
|
|
20
|
-
return {
|
|
21
|
-
phoneNumber: parsedValue.number,
|
|
22
|
-
international: parsedValue.formatInternational(),
|
|
23
|
-
country: parsedValue.country || defaultCountry
|
|
24
|
-
};
|
|
25
|
-
} catch (_unused) {
|
|
26
|
-
return {
|
|
27
|
-
phoneNumber: value,
|
|
28
|
-
international: formatIncompletePhoneNumber(value, defaultCountry),
|
|
29
|
-
country: defaultCountry
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export var getCursorPosition = function getCursorPosition(_ref) {
|
|
34
|
-
var event = _ref.event,
|
|
35
|
-
prevFormattedValue = _ref.prevFormattedValue,
|
|
36
|
-
newFormattedValue = _ref.newFormattedValue;
|
|
37
|
-
var inputType = event.nativeEvent.inputType,
|
|
38
|
-
_event$target = event.target,
|
|
39
|
-
newValue = _event$target.value,
|
|
40
|
-
selectionStart = _event$target.selectionStart;
|
|
41
|
-
if (selectionStart === newValue.length) return newFormattedValue.length;
|
|
42
|
-
var n = prevFormattedValue.substring(0, selectionStart).replace(/\s/g, "").length;
|
|
43
|
-
var cursor = 0;
|
|
44
|
-
for (var i = 0; i < n; ++i, ++cursor) {
|
|
45
|
-
if (newFormattedValue[cursor] === " ") ++cursor;
|
|
46
|
-
}
|
|
47
|
-
if (inputType !== "deleteContentBackward") {
|
|
48
|
-
if (newFormattedValue[selectionStart - 1] === " " && prevFormattedValue[selectionStart - 1] === " ") {
|
|
49
|
-
return cursor + 2;
|
|
50
|
-
} else if (prevFormattedValue[selectionStart - 1] === " ") {
|
|
51
|
-
return cursor + 1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return cursor;
|
|
55
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Alert } from "@bigbinary/neetoui";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
var AlertBlock = function AlertBlock(props) {
|
|
6
|
-
var _useTranslation = useTranslation(),
|
|
7
|
-
t = _useTranslation.t;
|
|
8
|
-
return /*#__PURE__*/React.createElement(Alert, _extends({
|
|
9
|
-
"data-cy": "reset-alert",
|
|
10
|
-
"data-testid": "reset-alert",
|
|
11
|
-
submitButtonLabel: t("neetoMolecules.common.actions.reset")
|
|
12
|
-
}, props));
|
|
13
|
-
};
|
|
14
|
-
export default AlertBlock;
|