@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,149 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
import { DirectUpload } from "@rails/activestorage";
|
|
6
|
-
import { isNotEmpty } from "@bigbinary/neeto-commons-frontend/pure";
|
|
7
|
-
import { Toastr } from "@bigbinary/neetoui";
|
|
8
|
-
import { useDropzone } from "react-dropzone";
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { DIRECT_UPLOAD_URL } from "../constants";
|
|
11
|
-
import { bytesToSize, getDominantColor } from "../utils";
|
|
12
|
-
var useDropzoneWithValidation = function useDropzoneWithValidation(_ref) {
|
|
13
|
-
var maxSize = _ref.maxSize,
|
|
14
|
-
acceptedTypes = _ref.acceptedTypes,
|
|
15
|
-
handleAcceptedFile = _ref.handleAcceptedFile,
|
|
16
|
-
_ref$isDominantColorE = _ref.isDominantColorEnabled,
|
|
17
|
-
isDominantColorEnabled = _ref$isDominantColorE === void 0 ? false : _ref$isDominantColorE;
|
|
18
|
-
var _useState = useState([]),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
files = _useState2[0],
|
|
21
|
-
setFiles = _useState2[1];
|
|
22
|
-
var _useState3 = useState(false),
|
|
23
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
24
|
-
error = _useState4[0],
|
|
25
|
-
setError = _useState4[1];
|
|
26
|
-
var _useState5 = useState(0),
|
|
27
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
28
|
-
uploadProgress = _useState6[0],
|
|
29
|
-
setUploadProgress = _useState6[1];
|
|
30
|
-
var maxSizeInReadableUnits = bytesToSize(maxSize);
|
|
31
|
-
var _useTranslation = useTranslation(),
|
|
32
|
-
t = _useTranslation.t;
|
|
33
|
-
var fileErrors = {
|
|
34
|
-
"file-invalid-type": t("neetoMolecules.themeSidebar.error.fileTypeError", {
|
|
35
|
-
acceptedTypes: acceptedTypes
|
|
36
|
-
}),
|
|
37
|
-
"file-too-large": t("neetoMolecules.themeSidebar.error.fileSizeLimitExceeded", {
|
|
38
|
-
maxSizeInReadableUnits: maxSizeInReadableUnits
|
|
39
|
-
})
|
|
40
|
-
};
|
|
41
|
-
var _useDropzone = useDropzone({
|
|
42
|
-
accept: acceptedTypes,
|
|
43
|
-
onDrop: function () {
|
|
44
|
-
var _onDrop = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(acceptedFiles) {
|
|
45
|
-
var newFiles;
|
|
46
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
47
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
48
|
-
case 0:
|
|
49
|
-
_context2.next = 2;
|
|
50
|
-
return new Promise(function (resolve) {
|
|
51
|
-
var files = [];
|
|
52
|
-
acceptedFiles.forEach(function (file) {
|
|
53
|
-
var upload = new DirectUpload(file, DIRECT_UPLOAD_URL, {
|
|
54
|
-
directUploadWillStoreFileWithXHR: function directUploadWillStoreFileWithXHR(xhr) {
|
|
55
|
-
xhr.upload.addEventListener("progress", function (event) {
|
|
56
|
-
var percentComplete = Math.round(event.loaded / event.total * 100);
|
|
57
|
-
setUploadProgress(percentComplete);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
upload.create( /*#__PURE__*/function () {
|
|
62
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(error, blob) {
|
|
63
|
-
var resolvedFile, dominantColor;
|
|
64
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
65
|
-
while (1) switch (_context.prev = _context.next) {
|
|
66
|
-
case 0:
|
|
67
|
-
if (!error) {
|
|
68
|
-
_context.next = 2;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
return _context.abrupt("return", Toastr.error(error));
|
|
72
|
-
case 2:
|
|
73
|
-
resolvedFile = {
|
|
74
|
-
url: blob.blob_url,
|
|
75
|
-
name: blob.filename,
|
|
76
|
-
signed_id: blob.signed_id,
|
|
77
|
-
type: blob.content_type,
|
|
78
|
-
size: blob.byte_size
|
|
79
|
-
};
|
|
80
|
-
if (!isDominantColorEnabled) {
|
|
81
|
-
_context.next = 8;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
_context.next = 6;
|
|
85
|
-
return getDominantColor(file);
|
|
86
|
-
case 6:
|
|
87
|
-
dominantColor = _context.sent;
|
|
88
|
-
resolvedFile.dominantColor = dominantColor;
|
|
89
|
-
case 8:
|
|
90
|
-
files.push(resolvedFile);
|
|
91
|
-
return _context.abrupt("return", resolve(files));
|
|
92
|
-
case 10:
|
|
93
|
-
case "end":
|
|
94
|
-
return _context.stop();
|
|
95
|
-
}
|
|
96
|
-
}, _callee);
|
|
97
|
-
}));
|
|
98
|
-
return function (_x2, _x3) {
|
|
99
|
-
return _ref2.apply(this, arguments);
|
|
100
|
-
};
|
|
101
|
-
}());
|
|
102
|
-
});
|
|
103
|
-
return files;
|
|
104
|
-
});
|
|
105
|
-
case 2:
|
|
106
|
-
newFiles = _context2.sent;
|
|
107
|
-
setFiles(newFiles.map(function (file) {
|
|
108
|
-
return handleAcceptedFile(file);
|
|
109
|
-
}));
|
|
110
|
-
case 4:
|
|
111
|
-
case "end":
|
|
112
|
-
return _context2.stop();
|
|
113
|
-
}
|
|
114
|
-
}, _callee2);
|
|
115
|
-
}));
|
|
116
|
-
function onDrop(_x) {
|
|
117
|
-
return _onDrop.apply(this, arguments);
|
|
118
|
-
}
|
|
119
|
-
return onDrop;
|
|
120
|
-
}(),
|
|
121
|
-
maxSize: maxSize,
|
|
122
|
-
onDropRejected: function onDropRejected(fileRejections) {
|
|
123
|
-
fileRejections.map(function (_ref3) {
|
|
124
|
-
var errors = _ref3.errors;
|
|
125
|
-
return errors.map(function (_ref4) {
|
|
126
|
-
var code = _ref4.code;
|
|
127
|
-
return Toastr.error(fileErrors[code] || t("neetoMolecules.common.somethingWentWrong"));
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}),
|
|
132
|
-
getRootProps = _useDropzone.getRootProps,
|
|
133
|
-
getInputProps = _useDropzone.getInputProps,
|
|
134
|
-
isDragActive = _useDropzone.isDragActive,
|
|
135
|
-
fileRejections = _useDropzone.fileRejections;
|
|
136
|
-
useEffect(function () {
|
|
137
|
-
setError(isNotEmpty(fileRejections));
|
|
138
|
-
}, [fileRejections]);
|
|
139
|
-
return {
|
|
140
|
-
files: files,
|
|
141
|
-
getRootProps: getRootProps,
|
|
142
|
-
getInputProps: getInputProps,
|
|
143
|
-
isDragActive: isDragActive,
|
|
144
|
-
fileRejections: fileRejections,
|
|
145
|
-
error: error,
|
|
146
|
-
uploadProgress: uploadProgress
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export default useDropzoneWithValidation;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
6
|
-
import { Spinner } from "@bigbinary/neetoui";
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { DESIGN_SCREENS } from "./constants";
|
|
9
|
-
import Customize from "./Customize";
|
|
10
|
-
import Themes from "./Themes";
|
|
11
|
-
import "./themeSidebar.scss";
|
|
12
|
-
import TitleBar from "./TitleBar";
|
|
13
|
-
import { scrollElementIntoView, transformTheme } from "./utils";
|
|
14
|
-
var ThemeSidebar = function ThemeSidebar(_ref) {
|
|
15
|
-
var defaultThemes = _ref.defaultThemes,
|
|
16
|
-
customThemes = _ref.customThemes,
|
|
17
|
-
createTheme = _ref.createTheme,
|
|
18
|
-
deleteTheme = _ref.deleteTheme,
|
|
19
|
-
editTheme = _ref.editTheme,
|
|
20
|
-
applyTheme = _ref.applyTheme,
|
|
21
|
-
currentTheme = _ref.currentTheme,
|
|
22
|
-
isLoadingThemes = _ref.isLoadingThemes,
|
|
23
|
-
applyingThemeId = _ref.applyingThemeId;
|
|
24
|
-
var _useTranslation = useTranslation(),
|
|
25
|
-
t = _useTranslation.t;
|
|
26
|
-
var _useState = useState(DESIGN_SCREENS.THEMES),
|
|
27
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
-
currentScreen = _useState2[0],
|
|
29
|
-
setCurrentScreen = _useState2[1];
|
|
30
|
-
var _useState3 = useState(null),
|
|
31
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
-
previewingTheme = _useState4[0],
|
|
33
|
-
setPreviewingTheme = _useState4[1];
|
|
34
|
-
var _useState5 = useState(null),
|
|
35
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
36
|
-
themeToHighlight = _useState6[0],
|
|
37
|
-
setThemeToHighlight = _useState6[1];
|
|
38
|
-
var didScrollActiveThemeIntoView = useRef(null);
|
|
39
|
-
useEffect(function () {
|
|
40
|
-
isLoadingThemes && setCurrentScreen(DESIGN_SCREENS.LOADING);
|
|
41
|
-
}, [isLoadingThemes]);
|
|
42
|
-
useEffect(function () {
|
|
43
|
-
!previewingTheme && setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
44
|
-
}, [previewingTheme]);
|
|
45
|
-
var handleEditTheme = function handleEditTheme(theme) {
|
|
46
|
-
setPreviewingTheme(theme);
|
|
47
|
-
setCurrentScreen(DESIGN_SCREENS.CUSTOMIZE);
|
|
48
|
-
};
|
|
49
|
-
var handleBackPress = function handleBackPress() {
|
|
50
|
-
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
51
|
-
setPreviewingTheme(null);
|
|
52
|
-
};
|
|
53
|
-
var handleCreateNewTheme = function handleCreateNewTheme() {
|
|
54
|
-
setPreviewingTheme(_objectSpread(_objectSpread({}, defaultThemes[0]), {}, {
|
|
55
|
-
id: null,
|
|
56
|
-
name: t("neetoMolecules.themeSidebar.defaultThemeName")
|
|
57
|
-
}));
|
|
58
|
-
setCurrentScreen(DESIGN_SCREENS.CUSTOMIZE);
|
|
59
|
-
};
|
|
60
|
-
var highlightTheme = function highlightTheme(themeToHighlight) {
|
|
61
|
-
setTimeout(function () {
|
|
62
|
-
scrollElementIntoView(themeToHighlight.id);
|
|
63
|
-
}, 1500);
|
|
64
|
-
setTimeout(function () {
|
|
65
|
-
setThemeToHighlight(null);
|
|
66
|
-
}, 4000);
|
|
67
|
-
setThemeToHighlight(themeToHighlight.id);
|
|
68
|
-
};
|
|
69
|
-
var createThemeCallback = function createThemeCallback(createdTheme) {
|
|
70
|
-
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
71
|
-
setPreviewingTheme(createdTheme.id);
|
|
72
|
-
highlightTheme(createdTheme);
|
|
73
|
-
};
|
|
74
|
-
var handleCloneTheme = function handleCloneTheme(data) {
|
|
75
|
-
var themeToClone = _objectSpread(_objectSpread({}, data), {}, {
|
|
76
|
-
name: "".concat(data.name, " - clone")
|
|
77
|
-
});
|
|
78
|
-
createTheme(themeToClone, createThemeCallback);
|
|
79
|
-
};
|
|
80
|
-
var handleFormSubmit = function handleFormSubmit(values) {
|
|
81
|
-
var formattedValues = transformTheme(values);
|
|
82
|
-
if (!(previewingTheme !== null && previewingTheme !== void 0 && previewingTheme.id)) {
|
|
83
|
-
createTheme(formattedValues, createThemeCallback);
|
|
84
|
-
} else {
|
|
85
|
-
editTheme(_objectSpread(_objectSpread({}, formattedValues), {}, {
|
|
86
|
-
id: previewingTheme.id
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
-
className: "neeto-molecules-theme-design-sidebar neeto-ui-border-gray-200 border-r"
|
|
92
|
-
}, /*#__PURE__*/React.createElement(TitleBar, {
|
|
93
|
-
currentScreen: currentScreen,
|
|
94
|
-
handleBackPress: handleBackPress,
|
|
95
|
-
handleCreateNewTheme: handleCreateNewTheme,
|
|
96
|
-
isNewTheme: !(previewingTheme !== null && previewingTheme !== void 0 && previewingTheme.id)
|
|
97
|
-
}), currentScreen === DESIGN_SCREENS.LOADING && /*#__PURE__*/React.createElement("div", {
|
|
98
|
-
className: "flex h-full w-full items-center justify-center"
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Spinner, null)), currentScreen === DESIGN_SCREENS.THEMES && /*#__PURE__*/React.createElement(Themes, {
|
|
100
|
-
applyingThemeId: applyingThemeId,
|
|
101
|
-
currentTheme: currentTheme,
|
|
102
|
-
customThemes: customThemes,
|
|
103
|
-
defaultThemes: defaultThemes,
|
|
104
|
-
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
105
|
-
highlightTheme: highlightTheme,
|
|
106
|
-
previewingTheme: previewingTheme,
|
|
107
|
-
setPreviewingTheme: setPreviewingTheme,
|
|
108
|
-
themeToHighlight: themeToHighlight,
|
|
109
|
-
onApplyTheme: applyTheme,
|
|
110
|
-
onCloneTheme: handleCloneTheme,
|
|
111
|
-
onDeleteTheme: deleteTheme,
|
|
112
|
-
onEditTheme: handleEditTheme
|
|
113
|
-
}), currentScreen === DESIGN_SCREENS.CUSTOMIZE && /*#__PURE__*/React.createElement(Customize, {
|
|
114
|
-
handleFormSubmit: handleFormSubmit,
|
|
115
|
-
theme: previewingTheme
|
|
116
|
-
}));
|
|
117
|
-
};
|
|
118
|
-
export default ThemeSidebar;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.neeto-molecules-theme-design-sidebar {
|
|
2
|
-
width: 320px;
|
|
3
|
-
height: 100%;
|
|
4
|
-
background-color: rgb(var(--neeto-ui-white));
|
|
5
|
-
box-shadow: var(--neeto-ui-shadow-s);
|
|
6
|
-
|
|
7
|
-
.neeto-molecules-theme-design-sidebar__header {
|
|
8
|
-
padding-top: 16px;
|
|
9
|
-
padding-bottom: 8px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.neeto-molecules-theme-design-sidebar__scroll {
|
|
13
|
-
height: 94%;
|
|
14
|
-
overflow-y: auto;
|
|
15
|
-
|
|
16
|
-
.neeto-ui-colorpicker__target {
|
|
17
|
-
.neeto-ui-colorpicker-target__code {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.neeto-molecules-theme-design-preview__wrapper {
|
|
25
|
-
position: relative;
|
|
26
|
-
background-color: rgb(var(--neeto-ui-gray-100));
|
|
27
|
-
height: 100%;
|
|
28
|
-
flex-grow: 1;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.neeto-molecules-theme-thumbnail--active {
|
|
32
|
-
border-color: rgb(var(--neeto-ui-primary-500)) !important;
|
|
33
|
-
box-shadow: 0px 0px 0px 1px rgb(var(--neeto-ui-primary-500)) !important;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.neeto-molecules-theme-thumbnail--preview-active {
|
|
37
|
-
border-color: rgb(var(--neeto-ui-gray-700));
|
|
38
|
-
box-shadow: 0px 0px 0px 1px rgb(var(--neeto-ui-gray-700));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.neeto-molecules-theme-thumbnail--highlight-active {
|
|
42
|
-
transition: border-color 100ms box-shadow 100ms;
|
|
43
|
-
border-color: rgb(var(--neeto-ui-success-500));
|
|
44
|
-
box-shadow: 0px 0px 0px 1px rgb(var(--neeto-ui-success-500));
|
|
45
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
var readFile = function readFile(file) {
|
|
7
|
-
return new Promise(function (resolve) {
|
|
8
|
-
var reader = new FileReader();
|
|
9
|
-
reader.onload = function () {
|
|
10
|
-
resolve(reader.result);
|
|
11
|
-
};
|
|
12
|
-
reader.readAsDataURL(file);
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var getImage = /*#__PURE__*/function () {
|
|
16
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
|
17
|
-
var image;
|
|
18
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
19
|
-
while (1) switch (_context.prev = _context.next) {
|
|
20
|
-
case 0:
|
|
21
|
-
image = new Image();
|
|
22
|
-
_context.next = 3;
|
|
23
|
-
return readFile(file);
|
|
24
|
-
case 3:
|
|
25
|
-
image.src = _context.sent;
|
|
26
|
-
return _context.abrupt("return", new Promise(function (resolve) {
|
|
27
|
-
image.onload = function () {
|
|
28
|
-
resolve(image);
|
|
29
|
-
};
|
|
30
|
-
}));
|
|
31
|
-
case 5:
|
|
32
|
-
case "end":
|
|
33
|
-
return _context.stop();
|
|
34
|
-
}
|
|
35
|
-
}, _callee);
|
|
36
|
-
}));
|
|
37
|
-
return function getImage(_x) {
|
|
38
|
-
return _ref.apply(this, arguments);
|
|
39
|
-
};
|
|
40
|
-
}();
|
|
41
|
-
export var transformTheme = function transformTheme(values) {
|
|
42
|
-
return {
|
|
43
|
-
name: values.name,
|
|
44
|
-
colorScheme: {
|
|
45
|
-
backgroundColor: values.backgroundColor,
|
|
46
|
-
questionColor: values.questionColor,
|
|
47
|
-
buttonBackgroundColor: values.buttonBackgroundColor,
|
|
48
|
-
buttonTextColor: values.buttonTextColor,
|
|
49
|
-
answerColor: values.answerColor,
|
|
50
|
-
answerTextColor: values.answerTextColor
|
|
51
|
-
},
|
|
52
|
-
backgroundImage: _objectSpread(_objectSpread({}, values.backgroundImage), {}, {
|
|
53
|
-
backgroundColor: values.backgroundColor,
|
|
54
|
-
backgroundOverlayOpacity: values.backgroundOverlayOpacity,
|
|
55
|
-
isDominantBackgroundColorEnabled: values.isDominantBackgroundColorEnabled,
|
|
56
|
-
backgroundPosition: values.backgroundImage.backgroundPosition
|
|
57
|
-
}),
|
|
58
|
-
fontOptions: {
|
|
59
|
-
fontFamily: values.fontFamily
|
|
60
|
-
},
|
|
61
|
-
buttonOptions: {
|
|
62
|
-
buttonBorderRadius: values.buttonBorderRadius
|
|
63
|
-
},
|
|
64
|
-
layout: {
|
|
65
|
-
isContentBackgroundEnabled: values.isContentBackgroundEnabled,
|
|
66
|
-
contentBackgroundColor: values.contentBackgroundColor,
|
|
67
|
-
welcomeTextAlignment: values.welcomeTextAlignment,
|
|
68
|
-
thankYouTextAlignment: values.thankYouTextAlignment,
|
|
69
|
-
questionsTextAlignment: values.questionsTextAlignment,
|
|
70
|
-
logo: values.logo
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export var parseTheme = function parseTheme(theme) {
|
|
75
|
-
var _theme$layout$logo;
|
|
76
|
-
return {
|
|
77
|
-
name: theme.name,
|
|
78
|
-
backgroundColor: theme.colorScheme.backgroundColor,
|
|
79
|
-
questionColor: theme.colorScheme.questionColor,
|
|
80
|
-
buttonBackgroundColor: theme.colorScheme.buttonBackgroundColor,
|
|
81
|
-
buttonTextColor: theme.colorScheme.buttonTextColor,
|
|
82
|
-
answerColor: theme.colorScheme.answerColor,
|
|
83
|
-
answerTextColor: theme.colorScheme.answerTextColor,
|
|
84
|
-
backgroundImage: theme.backgroundImage,
|
|
85
|
-
backgroundOverlayOpacity: theme.backgroundImage.backgroundOverlayOpacity,
|
|
86
|
-
fontFamily: theme.fontOptions.fontFamily,
|
|
87
|
-
buttonBorderRadius: theme.buttonOptions.buttonBorderRadius,
|
|
88
|
-
isDominantBackgroundColorEnabled: theme.backgroundImage.isDominantBackgroundColorEnabled,
|
|
89
|
-
isContentBackgroundEnabled: theme.layout.isContentBackgroundEnabled,
|
|
90
|
-
contentBackgroundColor: theme.layout.contentBackgroundColor,
|
|
91
|
-
welcomeTextAlignment: theme.layout.welcomeTextAlignment,
|
|
92
|
-
thankYouTextAlignment: theme.layout.thankYouTextAlignment,
|
|
93
|
-
questionsTextAlignment: theme.layout.questionsTextAlignment,
|
|
94
|
-
logo: (_theme$layout$logo = theme.layout.logo) !== null && _theme$layout$logo !== void 0 ? _theme$layout$logo : {}
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
export var getContrast = function getContrast(hexcolor) {
|
|
98
|
-
// If a leading # is provided, remove it
|
|
99
|
-
if (hexcolor.slice(0, 1) === "#") {
|
|
100
|
-
hexcolor = hexcolor.slice(1);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// If a three-character hexcode, make six-character
|
|
104
|
-
if (hexcolor.length === 3) {
|
|
105
|
-
hexcolor = hexcolor.split("").map(function (hex) {
|
|
106
|
-
return hex + hex;
|
|
107
|
-
}).join("");
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Convert to RGB value
|
|
111
|
-
var r = parseInt(hexcolor.substr(0, 2), 16);
|
|
112
|
-
var g = parseInt(hexcolor.substr(2, 2), 16);
|
|
113
|
-
var b = parseInt(hexcolor.substr(4, 2), 16);
|
|
114
|
-
|
|
115
|
-
// Get YIQ ratio
|
|
116
|
-
var yiq = (r * 299 + g * 587 + b * 114) / 1000;
|
|
117
|
-
|
|
118
|
-
// Check contrast
|
|
119
|
-
return yiq >= 128 ? "#000000" : "#ffffff";
|
|
120
|
-
};
|
|
121
|
-
export var hexToRgb = function hexToRgb(hex) {
|
|
122
|
-
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex.padEnd(7, "0"));
|
|
123
|
-
return result ? "".concat(parseInt(result[1], 16), ", ").concat(parseInt(result[2], 16), ", ").concat(parseInt(result[3], 16)) : null;
|
|
124
|
-
};
|
|
125
|
-
export var getDominantColor = /*#__PURE__*/function () {
|
|
126
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(file) {
|
|
127
|
-
var image, context, c, hex;
|
|
128
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
129
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
130
|
-
case 0:
|
|
131
|
-
_context2.next = 2;
|
|
132
|
-
return getImage(file);
|
|
133
|
-
case 2:
|
|
134
|
-
image = _context2.sent;
|
|
135
|
-
context = document.createElement("canvas").getContext("2d");
|
|
136
|
-
context === null || context === void 0 ? void 0 : context.drawImage(image, 0, 0, 1, 1);
|
|
137
|
-
c = context === null || context === void 0 ? void 0 : context.getImageData(0, 0, 1, 1).data;
|
|
138
|
-
if (!c) {
|
|
139
|
-
_context2.next = 9;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
hex = "#".concat(((1 << 24) + (c[0] << 16) + (c[1] << 8) + c[2]).toString(16).slice(1));
|
|
143
|
-
return _context2.abrupt("return", hex);
|
|
144
|
-
case 9:
|
|
145
|
-
return _context2.abrupt("return", null);
|
|
146
|
-
case 10:
|
|
147
|
-
case "end":
|
|
148
|
-
return _context2.stop();
|
|
149
|
-
}
|
|
150
|
-
}, _callee2);
|
|
151
|
-
}));
|
|
152
|
-
return function getDominantColor(_x2) {
|
|
153
|
-
return _ref2.apply(this, arguments);
|
|
154
|
-
};
|
|
155
|
-
}();
|
|
156
|
-
export var bytesToSize = function bytesToSize(bytes) {
|
|
157
|
-
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
158
|
-
if (bytes === 0) return "n/a";
|
|
159
|
-
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
|
160
|
-
if (i === 0) return "".concat(bytes, " ").concat(sizes[i], ")");
|
|
161
|
-
return "".concat((bytes / Math.pow(1024, i)).toFixed(1), " ").concat(sizes[i]);
|
|
162
|
-
};
|
|
163
|
-
export var scrollElementIntoView = function scrollElementIntoView(elementId) {
|
|
164
|
-
var _elementToScroll$scro;
|
|
165
|
-
var elementToScroll = document.getElementById(elementId);
|
|
166
|
-
elementToScroll === null || elementToScroll === void 0 ? void 0 : (_elementToScroll$scro = elementToScroll.scrollIntoView) === null || _elementToScroll$scro === void 0 ? void 0 : _elementToScroll$scro.call(elementToScroll, {
|
|
167
|
-
behavior: "smooth"
|
|
168
|
-
});
|
|
169
|
-
};
|
package/dist/TimeFormat/index.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/* eslint-disable @bigbinary/neeto/use-webpack-alias */
|
|
3
|
-
import React, { useEffect, useState } from "react";
|
|
4
|
-
import { Button, Modal, Typography } from "@bigbinary/neetoui";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { useUpdateTimeZone } from "./useTimeZoneApi";
|
|
7
|
-
import { checkIfTwoTimeZonesAreSame, getBrowserTimeZone, getUserTimeZone } from "./utils";
|
|
8
|
-
var TimezoneMismatchModal = function TimezoneMismatchModal(_ref) {
|
|
9
|
-
var _ref$isOpen = _ref.isOpen,
|
|
10
|
-
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
11
|
-
_ref$onClose = _ref.onClose,
|
|
12
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose;
|
|
13
|
-
var _useTranslation = useTranslation(),
|
|
14
|
-
t = _useTranslation.t;
|
|
15
|
-
var _useState = useState(false),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
isTimezoneModalOpen = _useState2[0],
|
|
18
|
-
setIsTimezoneModalOpen = _useState2[1];
|
|
19
|
-
var _useUpdateTimeZone = useUpdateTimeZone(),
|
|
20
|
-
isLoading = _useUpdateTimeZone.isLoading,
|
|
21
|
-
updateTimeZone = _useUpdateTimeZone.mutate;
|
|
22
|
-
var isUserAndBrowserTimeZoneSame = checkIfTwoTimeZonesAreSame(getUserTimeZone(), getBrowserTimeZone());
|
|
23
|
-
var handleUpdateTimeZone = function handleUpdateTimeZone() {
|
|
24
|
-
var payload = {
|
|
25
|
-
timeZone: getBrowserTimeZone()
|
|
26
|
-
};
|
|
27
|
-
updateTimeZone(payload, {
|
|
28
|
-
onSuccess: function onSuccess() {
|
|
29
|
-
setIsTimezoneModalOpen(false);
|
|
30
|
-
onClose();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var handleCancel = function handleCancel() {
|
|
35
|
-
setIsTimezoneModalOpen(false);
|
|
36
|
-
onClose();
|
|
37
|
-
};
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
if (process.env.RAILS_ENV !== "heroku") {
|
|
40
|
-
setIsTimezoneModalOpen(!isUserAndBrowserTimeZoneSame);
|
|
41
|
-
}
|
|
42
|
-
}, []);
|
|
43
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
44
|
-
closeOnOutsideClick: false,
|
|
45
|
-
isOpen: isTimezoneModalOpen || isOpen,
|
|
46
|
-
size: "large",
|
|
47
|
-
onClose: handleCancel
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Modal.Header, null, /*#__PURE__*/React.createElement(Typography, {
|
|
49
|
-
style: "h2",
|
|
50
|
-
weight: "normal"
|
|
51
|
-
}, t("neetoMolecules.alert.timezone.title"))), /*#__PURE__*/React.createElement(Modal.Body, null, /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
className: "flex flex-col space-y-4"
|
|
53
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
54
|
-
component: "span",
|
|
55
|
-
style: "body2"
|
|
56
|
-
}, t("neetoMolecules.alert.timezone.message", {
|
|
57
|
-
entity: globalProps.appName
|
|
58
|
-
})), /*#__PURE__*/React.createElement(Typography, {
|
|
59
|
-
component: "span",
|
|
60
|
-
style: "h4"
|
|
61
|
-
}, t("neetoMolecules.alert.timezone.userTimezone", {
|
|
62
|
-
entity: getUserTimeZone()
|
|
63
|
-
})), /*#__PURE__*/React.createElement(Typography, {
|
|
64
|
-
component: "span",
|
|
65
|
-
style: "h4"
|
|
66
|
-
}, t("neetoMolecules.alert.timezone.browserTimezone", {
|
|
67
|
-
entity: getBrowserTimeZone()
|
|
68
|
-
})))), /*#__PURE__*/React.createElement(Modal.Footer, {
|
|
69
|
-
className: "space-x-2"
|
|
70
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
71
|
-
"data-testid": "update-timezone-button",
|
|
72
|
-
disabled: isLoading,
|
|
73
|
-
label: t("neetoMolecules.alert.timezone.updateProfile"),
|
|
74
|
-
loading: isLoading,
|
|
75
|
-
style: "primary",
|
|
76
|
-
onClick: handleUpdateTimeZone
|
|
77
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
78
|
-
label: t("neetoMolecules.common.actions.cancel"),
|
|
79
|
-
style: "text",
|
|
80
|
-
onClick: handleCancel
|
|
81
|
-
})));
|
|
82
|
-
};
|
|
83
|
-
export default TimezoneMismatchModal;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useMutation } from "react-query";
|
|
2
|
-
import timeZoneApi from "./apis/time_zone";
|
|
3
|
-
var useUpdateTimeZone = function useUpdateTimeZone() {
|
|
4
|
-
return useMutation(timeZoneApi.updateTimeZone, {
|
|
5
|
-
onSuccess: function onSuccess() {
|
|
6
|
-
return window.location.reload();
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export { useUpdateTimeZone };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
import { globalProps } from "@bigbinary/neeto-commons-frontend/initializers";
|
|
3
|
-
export var getBrowserTimeZone = function getBrowserTimeZone() {
|
|
4
|
-
return dayjs.tz.guess();
|
|
5
|
-
};
|
|
6
|
-
export var getUserTimeZone = function getUserTimeZone() {
|
|
7
|
-
var _globalProps$user;
|
|
8
|
-
return (_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.timeZone;
|
|
9
|
-
};
|
|
10
|
-
export var checkIfTwoTimeZonesAreSame = function checkIfTwoTimeZonesAreSame(timeZone1, timeZone2) {
|
|
11
|
-
return dayjs().tz(timeZone1).format("Z") === dayjs().tz(timeZone2).format("Z");
|
|
12
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["t", "enabledCondition", "name", "isDisabled", "switchDataCy"];
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { withT } from "@bigbinary/neeto-commons-frontend/react-utils";
|
|
9
|
-
import { Tooltip } from "@bigbinary/neetoui";
|
|
10
|
-
import { Switch as FormikSwitch } from "@bigbinary/neetoui/formik";
|
|
11
|
-
var TooltipSwitch = withT(function (_ref) {
|
|
12
|
-
var t = _ref.t,
|
|
13
|
-
enabledCondition = _ref.enabledCondition,
|
|
14
|
-
_ref$name = _ref.name,
|
|
15
|
-
name = _ref$name === void 0 ? "" : _ref$name,
|
|
16
|
-
_ref$isDisabled = _ref.isDisabled,
|
|
17
|
-
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
18
|
-
switchDataCy = _ref.switchDataCy,
|
|
19
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
21
|
-
position: "top",
|
|
22
|
-
content: enabledCondition ? t("neetoMolecules.toggleFeatureCard.switchTooltip.enabled") : t("neetoMolecules.toggleFeatureCard.switchTooltip.disabled")
|
|
23
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormikSwitch, _extends({
|
|
24
|
-
"data-cy": switchDataCy,
|
|
25
|
-
"data-testid": "toggle-feature-card-switch",
|
|
26
|
-
disabled: isDisabled
|
|
27
|
-
}, _objectSpread({
|
|
28
|
-
name: name
|
|
29
|
-
}, otherProps)))));
|
|
30
|
-
});
|
|
31
|
-
export default TooltipSwitch;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
var useScrollIntoView = function useScrollIntoView(_ref) {
|
|
3
|
-
var elementId = _ref.elementId,
|
|
4
|
-
trigger = _ref.trigger;
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
var _document$getElementB;
|
|
7
|
-
if (!trigger) return;
|
|
8
|
-
(_document$getElementB = document.getElementById(elementId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.scrollIntoView();
|
|
9
|
-
}, [trigger]);
|
|
10
|
-
};
|
|
11
|
-
export default useScrollIntoView;
|