@bigbinary/neeto-molecules 1.1.10 → 1.1.11
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/autosaveinput.scss +15 -0
- package/dist/AutoSaveInput/constants.js +13 -0
- package/dist/AutoSaveInput/index.js +124 -0
- package/dist/AutoSaveInput/utils.js +10 -0
- package/dist/Breadcrumbs/breadcrumbs.scss +33 -0
- package/dist/Breadcrumbs/index.js +31 -0
- package/dist/BrowserSupport/Callout.js +15 -0
- package/dist/BrowserSupport/ContactUs.js +21 -0
- package/dist/BrowserSupport/DownloadLink.js +17 -0
- package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +17 -0
- package/dist/BrowserSupport/UnknownBrowser.js +13 -0
- package/dist/BrowserSupport/UnsupportedBrowser.js +24 -0
- package/dist/BrowserSupport/UnsupportedBrowserMessage.js +22 -0
- package/dist/BrowserSupport/UnsupportedBrowserVersion.js +27 -0
- package/dist/BrowserSupport/UnsupportedVersionMessage.js +30 -0
- package/dist/BrowserSupport/browsersupport.scss +71 -0
- package/dist/BrowserSupport/constants.js +63 -0
- package/dist/BrowserSupport/index.js +58 -0
- package/dist/BrowserSupport/utils.js +32 -0
- package/dist/CalendarView/CustomDatePicker.js +87 -0
- package/dist/CalendarView/Header.js +53 -0
- package/dist/CalendarView/constants.js +19 -0
- package/dist/CalendarView/index.js +83 -0
- package/dist/CalendarView/utils.js +50 -0
- package/dist/Codeblock/index.js +30 -0
- package/dist/{Columns.js → Columns/index.js} +13 -130
- package/dist/Columns/utils.js +20 -0
- package/dist/ConfirmationModal/constants.js +3 -0
- package/dist/{ConfirmationModal.js → ConfirmationModal/index.js} +7 -23
- package/dist/ConfirmationModal/utils.js +10 -0
- package/dist/Container/container.scss +21 -0
- package/dist/Container/index.js +23 -0
- package/dist/CopyToClipboardButton/constants.js +13 -0
- package/dist/CopyToClipboardButton/copyToClipboard.scss +22 -0
- package/dist/CopyToClipboardButton/index.js +59 -0
- package/dist/CustomDomain/index.js +98 -0
- package/dist/CustomDomainDashboard/DeleteAlert.js +28 -0
- package/dist/CustomDomainDashboard/Header.js +32 -0
- package/dist/CustomDomainDashboard/Manage/Record.js +42 -0
- package/dist/CustomDomainDashboard/Manage/StatusInfo.js +21 -0
- package/dist/CustomDomainDashboard/Manage/TagBlock.js +36 -0
- package/dist/CustomDomainDashboard/Manage/constants.js +4 -0
- package/dist/CustomDomainDashboard/Manage/index.js +124 -0
- package/dist/CustomDomainDashboard/Manage/utils.js +8 -0
- package/dist/CustomDomainDashboard/api.js +35 -0
- package/dist/CustomDomainDashboard/constants.js +2 -0
- package/dist/CustomDomainDashboard/index.js +118 -0
- package/dist/CustomDomainDashboard/useCustomDomainApi.js +71 -0
- package/dist/CustomDomainDashboard/utils.js +84 -0
- package/dist/{DateFormat.js → DateFormat/index.js} +8 -25
- package/dist/DateRangeFilter/index.js +60 -0
- package/dist/DateRangeFilter/utils.js +113 -0
- package/dist/DynamicVariables/dynamic-variables.scss +34 -0
- package/dist/DynamicVariables/index.js +59 -0
- package/dist/DynamicVariables/utils.js +37 -0
- package/dist/EmailForm/EmailForm.js +97 -0
- package/dist/EmailForm/EmailFormProvider.js +45 -0
- package/dist/EmailForm/EmailPreview.js +129 -0
- package/dist/EmailForm/ReplyToField.js +55 -0
- package/dist/EmailForm/SendToField.js +27 -0
- package/dist/EmailForm/SubjectField.js +64 -0
- package/dist/EmailForm/constants.js +33 -0
- package/dist/EmailForm/contexts/EmailForm.js +7 -0
- package/dist/EmailForm/index.js +4 -0
- package/dist/EmailForm/utils.js +10 -0
- package/dist/EmailPreview/index.js +2 -0
- package/dist/{ErrorPage.js → ErrorPage/constants.js} +36 -175
- package/dist/ErrorPage/index.js +78 -0
- package/dist/Header/Breadcrumbs.js +31 -0
- package/dist/Header/Dropdown.js +12 -0
- package/dist/Header/constants.js +6 -0
- package/dist/Header/header.scss +121 -0
- package/dist/Header/index.js +61 -0
- package/dist/IconPicker/Icon.js +34 -0
- package/dist/IconPicker/NoResults.js +12 -0
- package/dist/IconPicker/constants.js +8 -0
- package/dist/IconPicker/icon-picker.scss +1 -0
- package/dist/IconPicker/index.js +164 -0
- package/dist/ImageWithFallback/ImagePlaceholder.js +16 -0
- package/dist/ImageWithFallback/index.js +31 -0
- package/dist/IntegrationCard/Dropdown.js +45 -0
- package/dist/IntegrationCard/Status.js +25 -0
- package/dist/IntegrationCard/index.js +128 -0
- package/dist/IntegrationDisconnectAlert/index.js +36 -0
- package/dist/{IntegrationWalkthroughModal.js → IntegrationWalkthroughModal/index.js} +6 -8
- package/dist/IpRestriction/AllowedIpRanges.js +72 -0
- package/dist/IpRestriction/CurrentIp.js +26 -0
- package/dist/IpRestriction/FormRow.js +77 -0
- package/dist/IpRestriction/Row.js +86 -0
- package/dist/IpRestriction/apis/allowed_ip_ranges.js +28 -0
- package/dist/IpRestriction/apis/current_ip.js +11 -0
- package/dist/IpRestriction/apis/ip_restriction.js +16 -0
- package/dist/IpRestriction/constants.js +11 -0
- package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +34 -0
- package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +10 -0
- package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +18 -0
- package/dist/IpRestriction/index.js +102 -0
- package/dist/IpRestriction/utils.js +67 -0
- package/dist/KeyboardShortcuts/Pane/HotKey.js +44 -0
- package/dist/KeyboardShortcuts/Pane/HotKeyList.js +42 -0
- package/dist/KeyboardShortcuts/Pane/constants.js +25 -0
- package/dist/KeyboardShortcuts/Pane/index.js +61 -0
- package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +5 -0
- package/dist/KeyboardShortcuts/Pane/utils.js +66 -0
- package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +31 -0
- package/dist/KeyboardShortcuts/index.js +9 -0
- package/dist/LoginPage/Form.js +57 -0
- package/dist/LoginPage/constants.js +12 -0
- package/dist/LoginPage/index.js +103 -0
- package/dist/MenuBar/AddNew.js +25 -0
- package/dist/MenuBar/Block.js +60 -0
- package/dist/MenuBar/Item.js +32 -0
- package/dist/MenuBar/Search.js +39 -0
- package/dist/MenuBar/SubTitle.js +23 -0
- package/dist/MenuBar/index.js +46 -0
- package/dist/MenuBar/menubar.scss +154 -0
- package/dist/Metadata/Block.js +30 -0
- package/dist/Metadata/DetailsBlock.js +86 -0
- package/dist/Metadata/constants.js +9 -0
- package/dist/Metadata/index.js +29 -0
- package/dist/Metadata/metadata.scss +15 -0
- package/dist/MoreDropdown/constants.js +25 -0
- package/dist/{MoreDropdown.js → MoreDropdown/index.js} +9 -102
- package/dist/NavigationHeader/LeftBlock.js +32 -0
- package/dist/NavigationHeader/Navigation.js +24 -0
- package/dist/NavigationHeader/RightBlock.js +68 -0
- package/dist/NavigationHeader/constants.js +11 -0
- package/dist/NavigationHeader/index.js +19 -0
- package/dist/NavigationHeader/navigation-header.scss +3 -0
- package/dist/NeetoWidget/CodeBlock.js +57 -0
- package/dist/NeetoWidget/CodeSnippet.js +119 -0
- package/dist/NeetoWidget/EmbedCode.js +281 -0
- package/dist/NeetoWidget/Main.js +19 -0
- package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +25 -0
- package/dist/NeetoWidget/SelectionSwitches/index.js +44 -0
- package/dist/NeetoWidget/SyntaxHighlighter.js +17 -0
- package/dist/NeetoWidget/api.js +20 -0
- package/dist/NeetoWidget/constants.js +62 -0
- package/dist/NeetoWidget/hooks/useForceUpdate.js +14 -0
- package/dist/NeetoWidget/index.js +7 -0
- package/dist/NeetoWidget/mutations.js +9 -0
- package/dist/NeetoWidget/queries.js +32 -0
- package/dist/NeetoWidget/utils.js +83 -0
- package/dist/PageLoader/index.js +81 -0
- package/dist/PageLoader/page-loader.scss +95 -0
- package/dist/PhoneNumber/CountryPicker/SingleValue.js +21 -0
- package/dist/PhoneNumber/CountryPicker/constants.js +26 -0
- package/dist/PhoneNumber/CountryPicker/index.js +59 -0
- package/dist/PhoneNumber/FormikPhoneNumberInput.js +21 -0
- package/dist/PhoneNumber/PhoneNumber.js +30 -0
- package/dist/PhoneNumber/PhoneNumberInput.js +79 -0
- package/dist/PhoneNumber/index.js +5 -0
- package/dist/PhoneNumber/utils.js +55 -0
- package/dist/PublishBlock/AlertBlock.js +14 -0
- package/dist/PublishBlock/index.js +100 -0
- package/dist/PublishBlock/publish-block.scss +25 -0
- package/dist/Rename/DummySpan.js +21 -0
- package/dist/Rename/constants.js +1 -0
- package/dist/Rename/index.js +191 -0
- package/dist/Rename/rename.scss +69 -0
- package/dist/Rename/utils.js +10 -0
- package/dist/ResponsiveDevicePicker/constants.js +19 -0
- package/dist/ResponsiveDevicePicker/index.js +36 -0
- package/dist/Schedule/DisplayAvailability.js +58 -0
- package/dist/Schedule/Fields.js +43 -0
- package/dist/Schedule/Form/ScheduleRow.js +125 -0
- package/dist/Schedule/Form/constants.js +20 -0
- package/dist/Schedule/Form/index.js +144 -0
- package/dist/Schedule/Form/utils.js +63 -0
- package/dist/Schedule/Header.js +76 -0
- package/dist/Schedule/ScheduleContext.js +8 -0
- package/dist/Schedule/constants.js +8 -0
- package/dist/Schedule/dayjsExtended/constants.js +1 -0
- package/dist/Schedule/dayjsExtended/index.js +14 -0
- package/dist/Schedule/dayjsExtended/range.js +73 -0
- package/dist/Schedule/index.js +80 -0
- package/dist/Schedule/utils.js +152 -0
- package/dist/Scrollable/constants.js +8 -0
- package/dist/Scrollable/index.js +26 -0
- package/dist/Scrollable/scrollable.scss +32 -0
- package/dist/Security/AllowedKeywords/Add.js +38 -0
- package/dist/Security/AllowedKeywords/index.js +38 -0
- package/dist/Security/PasswordBlock.js +31 -0
- package/dist/Security/RadioBlock.js +38 -0
- package/dist/Security/api.js +12 -0
- package/dist/Security/constants.js +58 -0
- package/dist/Security/index.js +68 -0
- package/dist/Security/useSecurityApi.js +22 -0
- package/dist/Security/utils.js +31 -0
- package/dist/SendToFields/FilePicker.js +34 -0
- package/dist/SendToFields/constants.js +6 -0
- package/dist/SendToFields/index.js +102 -0
- package/dist/SendToFields/utils.js +54 -0
- package/dist/Settings/Category.js +30 -0
- package/dist/Settings/Item.js +38 -0
- package/dist/Settings/index.js +37 -0
- package/dist/Settings/utils.js +4 -0
- package/dist/ShareViaEmail/EmailBodyEditor.js +22 -0
- package/dist/ShareViaEmail/FilePicker.js +43 -0
- package/dist/ShareViaEmail/Form.js +101 -0
- package/dist/ShareViaEmail/FormikDatePicker.js +24 -0
- package/dist/ShareViaEmail/constants.js +14 -0
- package/dist/ShareViaEmail/index.js +89 -0
- package/dist/ShareViaEmail/utils.js +72 -0
- package/dist/ShareViaLink/EditURL.js +74 -0
- package/dist/ShareViaLink/Link.js +105 -0
- package/dist/ShareViaLink/QRCode.js +41 -0
- package/dist/ShareViaLink/RegenerateURL.js +47 -0
- package/dist/ShareViaLink/SocialMedia.js +52 -0
- package/dist/ShareViaLink/constants.js +25 -0
- package/dist/ShareViaLink/edit-url.scss +8 -0
- package/dist/ShareViaLink/index.js +46 -0
- package/dist/ShareViaLink/utils.js +47 -0
- package/dist/Sidebar/AppSwitcher/AppLink.js +45 -0
- package/dist/Sidebar/AppSwitcher/Backdrop.js +13 -0
- package/dist/Sidebar/AppSwitcher/Body.js +65 -0
- package/dist/Sidebar/AppSwitcher/Portal.js +27 -0
- package/dist/Sidebar/AppSwitcher/appswitcher.scss +164 -0
- package/dist/Sidebar/AppSwitcher/index.js +47 -0
- package/dist/Sidebar/AppSwitcher/utils.js +25 -0
- package/dist/Sidebar/Chevron.js +14 -0
- package/dist/Sidebar/FeaturedTooltip.js +19 -0
- package/dist/Sidebar/Footer/AppSwitcherButton.js +48 -0
- package/dist/Sidebar/Footer/ProfileButton.js +30 -0
- package/dist/Sidebar/Footer/index.js +56 -0
- package/dist/Sidebar/Footer/utils.js +39 -0
- package/dist/Sidebar/Header.js +33 -0
- package/dist/Sidebar/HelpSection/HelpSectionMenu.js +52 -0
- package/dist/Sidebar/HelpSection/index.js +32 -0
- package/dist/Sidebar/Links.js +112 -0
- package/dist/Sidebar/NavIconWrapper.js +20 -0
- package/dist/Sidebar/ProfileSection/LinkSection.js +36 -0
- package/dist/Sidebar/ProfileSection/ProfileMenu.js +48 -0
- package/dist/Sidebar/ProfileSection/index.js +42 -0
- package/dist/Sidebar/constants.js +40 -0
- package/dist/Sidebar/index.js +94 -0
- package/dist/Sidebar/sidebar.scss +379 -0
- package/dist/Sidebar/utils.js +18 -0
- package/dist/SubHeader/RightBlock/Columns.js +35 -0
- package/dist/SubHeader/RightBlock/Download.js +28 -0
- package/dist/SubHeader/RightBlock/Filter.js +31 -0
- package/dist/SubHeader/RightBlock/index.js +21 -0
- package/dist/SubHeader/RightBlock/utils.js +13 -0
- package/dist/SubHeader/index.js +28 -0
- package/dist/SubHeader/subheader.scss +78 -0
- package/dist/TableWrapper/index.js +18 -0
- package/dist/ThemeSidebar/Customize/Logo.js +39 -0
- package/dist/ThemeSidebar/Customize/Properties.js +170 -0
- package/dist/ThemeSidebar/Customize/index.js +66 -0
- package/dist/ThemeSidebar/Themes/ThemeCard.js +135 -0
- package/dist/ThemeSidebar/Themes/index.js +110 -0
- package/dist/ThemeSidebar/TitleBar.js +62 -0
- package/dist/ThemeSidebar/constants.js +127 -0
- package/dist/ThemeSidebar/fields/AlignmentBlock.js +50 -0
- package/dist/ThemeSidebar/fields/Card.js +19 -0
- package/dist/ThemeSidebar/fields/ColorBlock.js +19 -0
- package/dist/ThemeSidebar/fields/FontPickerBlock.js +35 -0
- package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +67 -0
- package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +22 -0
- package/dist/ThemeSidebar/fields/ImageBlock/index.js +55 -0
- package/dist/ThemeSidebar/fields/SelectBlock.js +24 -0
- package/dist/ThemeSidebar/fields/SliderBlock.js +30 -0
- package/dist/ThemeSidebar/fields/SwitchBlock.js +17 -0
- package/dist/ThemeSidebar/fields/TextBlock.js +13 -0
- package/dist/ThemeSidebar/fields/slider.scss +199 -0
- package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +149 -0
- package/dist/ThemeSidebar/index.js +118 -0
- package/dist/ThemeSidebar/themeSidebar.scss +45 -0
- package/dist/ThemeSidebar/utils.js +169 -0
- package/dist/TimeFormat/index.js +3 -0
- package/dist/TimezoneMismatchModal/apis/time_zone.js +9 -0
- package/dist/TimezoneMismatchModal/index.js +83 -0
- package/dist/TimezoneMismatchModal/useTimeZoneApi.js +10 -0
- package/dist/TimezoneMismatchModal/utils.js +12 -0
- package/dist/ToggleFeatureCard/ToolTipSwitch.js +31 -0
- package/dist/ToggleFeatureCard/constants.js +5 -0
- package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +11 -0
- package/dist/ToggleFeatureCard/index.js +148 -0
- package/dist/ToggleFeatureCard/toggleFeatureCard.scss +4 -0
- package/package.json +27 -34
- package/dist/AutoSaveInput.cjs.js +0 -724
- package/dist/AutoSaveInput.cjs.js.map +0 -1
- package/dist/AutoSaveInput.js +0 -718
- package/dist/AutoSaveInput.js.map +0 -1
- package/dist/Breadcrumbs.cjs.js +0 -44
- package/dist/Breadcrumbs.cjs.js.map +0 -1
- package/dist/Breadcrumbs.js +0 -38
- package/dist/Breadcrumbs.js.map +0 -1
- package/dist/BrowserSupport.cjs.js +0 -1731
- package/dist/BrowserSupport.cjs.js.map +0 -1
- package/dist/BrowserSupport.js +0 -1725
- package/dist/BrowserSupport.js.map +0 -1
- package/dist/CalendarView.cjs.js +0 -610
- package/dist/CalendarView.cjs.js.map +0 -1
- package/dist/CalendarView.js +0 -598
- package/dist/CalendarView.js.map +0 -1
- package/dist/Codeblock.cjs.js +0 -302
- package/dist/Codeblock.cjs.js.map +0 -1
- package/dist/Codeblock.js +0 -296
- package/dist/Codeblock.js.map +0 -1
- package/dist/Columns.cjs.js +0 -248
- package/dist/Columns.cjs.js.map +0 -1
- package/dist/Columns.js.map +0 -1
- package/dist/ConfirmationModal.cjs.js +0 -87
- package/dist/ConfirmationModal.cjs.js.map +0 -1
- package/dist/ConfirmationModal.js.map +0 -1
- package/dist/Container.cjs.js +0 -1277
- package/dist/Container.cjs.js.map +0 -1
- package/dist/Container.js +0 -1271
- package/dist/Container.js.map +0 -1
- package/dist/CopyToClipboardButton.cjs.js +0 -275
- package/dist/CopyToClipboardButton.cjs.js.map +0 -1
- package/dist/CopyToClipboardButton.js +0 -269
- package/dist/CopyToClipboardButton.js.map +0 -1
- package/dist/CustomDomain.cjs.js +0 -774
- package/dist/CustomDomain.cjs.js.map +0 -1
- package/dist/CustomDomain.js +0 -747
- package/dist/CustomDomain.js.map +0 -1
- package/dist/CustomDomainDashboard.cjs.js +0 -2370
- package/dist/CustomDomainDashboard.cjs.js.map +0 -1
- package/dist/CustomDomainDashboard.js +0 -2342
- package/dist/CustomDomainDashboard.js.map +0 -1
- package/dist/DateFormat.cjs.js +0 -51
- package/dist/DateFormat.cjs.js.map +0 -1
- package/dist/DateFormat.js.map +0 -1
- package/dist/DateRangeFilter.cjs.js +0 -236
- package/dist/DateRangeFilter.cjs.js.map +0 -1
- package/dist/DateRangeFilter.js +0 -229
- package/dist/DateRangeFilter.js.map +0 -1
- package/dist/DynamicVariables.cjs.js +0 -189
- package/dist/DynamicVariables.cjs.js.map +0 -1
- package/dist/DynamicVariables.js +0 -183
- package/dist/DynamicVariables.js.map +0 -1
- package/dist/EmailForm.cjs.js +0 -4295
- package/dist/EmailForm.cjs.js.map +0 -1
- package/dist/EmailForm.js +0 -4265
- package/dist/EmailForm.js.map +0 -1
- package/dist/EmailPreview.cjs.js +0 -1419
- package/dist/EmailPreview.cjs.js.map +0 -1
- package/dist/EmailPreview.js +0 -1413
- package/dist/EmailPreview.js.map +0 -1
- package/dist/ErrorPage.cjs.js +0 -226
- package/dist/ErrorPage.cjs.js.map +0 -1
- package/dist/ErrorPage.js.map +0 -1
- package/dist/Header.cjs.js +0 -188
- package/dist/Header.cjs.js.map +0 -1
- package/dist/Header.js +0 -182
- package/dist/Header.js.map +0 -1
- package/dist/IconPicker.cjs.js +0 -1308
- package/dist/IconPicker.cjs.js.map +0 -1
- package/dist/IconPicker.js +0 -1302
- package/dist/IconPicker.js.map +0 -1
- package/dist/ImageWithFallback.cjs.js +0 -247
- package/dist/ImageWithFallback.cjs.js.map +0 -1
- package/dist/ImageWithFallback.js +0 -241
- package/dist/ImageWithFallback.js.map +0 -1
- package/dist/IntegrationCard.cjs.js +0 -409
- package/dist/IntegrationCard.cjs.js.map +0 -1
- package/dist/IntegrationCard.js +0 -403
- package/dist/IntegrationCard.js.map +0 -1
- package/dist/IntegrationDisconnectAlert.cjs.js +0 -89
- package/dist/IntegrationDisconnectAlert.cjs.js.map +0 -1
- package/dist/IntegrationDisconnectAlert.js +0 -80
- package/dist/IntegrationDisconnectAlert.js.map +0 -1
- package/dist/IntegrationWalkthroughModal.cjs.js +0 -50
- package/dist/IntegrationWalkthroughModal.cjs.js.map +0 -1
- package/dist/IntegrationWalkthroughModal.js.map +0 -1
- package/dist/IpRestriction.cjs.js +0 -3931
- package/dist/IpRestriction.cjs.js.map +0 -1
- package/dist/IpRestriction.js +0 -3905
- package/dist/IpRestriction.js.map +0 -1
- package/dist/KeyboardShortcuts.cjs.js +0 -2263
- package/dist/KeyboardShortcuts.cjs.js.map +0 -1
- package/dist/KeyboardShortcuts.js +0 -2256
- package/dist/KeyboardShortcuts.js.map +0 -1
- package/dist/LoginPage.cjs.js +0 -618
- package/dist/LoginPage.cjs.js.map +0 -1
- package/dist/LoginPage.js +0 -593
- package/dist/LoginPage.js.map +0 -1
- package/dist/MenuBar.cjs.js +0 -34273
- package/dist/MenuBar.cjs.js.map +0 -1
- package/dist/MenuBar.js +0 -34267
- package/dist/MenuBar.js.map +0 -1
- package/dist/Metadata.cjs.js +0 -272
- package/dist/Metadata.cjs.js.map +0 -1
- package/dist/Metadata.js +0 -266
- package/dist/Metadata.js.map +0 -1
- package/dist/MoreDropdown.cjs.js +0 -168
- package/dist/MoreDropdown.cjs.js.map +0 -1
- package/dist/MoreDropdown.js.map +0 -1
- package/dist/NavigationHeader.cjs.js +0 -756
- package/dist/NavigationHeader.cjs.js.map +0 -1
- package/dist/NavigationHeader.js +0 -750
- package/dist/NavigationHeader.js.map +0 -1
- package/dist/NeetoWidget.cjs.js +0 -3375
- package/dist/NeetoWidget.cjs.js.map +0 -1
- package/dist/NeetoWidget.js +0 -3348
- package/dist/NeetoWidget.js.map +0 -1
- package/dist/PageLoader.cjs.js +0 -158
- package/dist/PageLoader.cjs.js.map +0 -1
- package/dist/PageLoader.js +0 -134
- package/dist/PageLoader.js.map +0 -1
- package/dist/PhoneNumber.cjs.js +0 -7021
- package/dist/PhoneNumber.cjs.js.map +0 -1
- package/dist/PhoneNumber.js +0 -6989
- package/dist/PhoneNumber.js.map +0 -1
- package/dist/PublishBlock.cjs.js +0 -224
- package/dist/PublishBlock.cjs.js.map +0 -1
- package/dist/PublishBlock.js +0 -218
- package/dist/PublishBlock.js.map +0 -1
- package/dist/Rename.cjs.js +0 -516
- package/dist/Rename.cjs.js.map +0 -1
- package/dist/Rename.js +0 -510
- package/dist/Rename.js.map +0 -1
- package/dist/ResponsiveDevicePicker.cjs.js +0 -260
- package/dist/ResponsiveDevicePicker.cjs.js.map +0 -1
- package/dist/ResponsiveDevicePicker.js +0 -254
- package/dist/ResponsiveDevicePicker.js.map +0 -1
- package/dist/Schedule.cjs.js +0 -1077
- package/dist/Schedule.cjs.js.map +0 -1
- package/dist/Schedule.js +0 -1046
- package/dist/Schedule.js.map +0 -1
- package/dist/Scrollable.cjs.js +0 -188
- package/dist/Scrollable.cjs.js.map +0 -1
- package/dist/Scrollable.js +0 -182
- package/dist/Scrollable.js.map +0 -1
- package/dist/Security.cjs.js +0 -1921
- package/dist/Security.cjs.js.map +0 -1
- package/dist/Security.js +0 -1895
- package/dist/Security.js.map +0 -1
- package/dist/SendToFields.cjs.js +0 -2524
- package/dist/SendToFields.cjs.js.map +0 -1
- package/dist/SendToFields.js +0 -2517
- package/dist/SendToFields.js.map +0 -1
- package/dist/Settings.cjs.js +0 -501
- package/dist/Settings.cjs.js.map +0 -1
- package/dist/Settings.js +0 -495
- package/dist/Settings.js.map +0 -1
- package/dist/ShareViaEmail.cjs.js +0 -4272
- package/dist/ShareViaEmail.cjs.js.map +0 -1
- package/dist/ShareViaEmail.js +0 -4246
- package/dist/ShareViaEmail.js.map +0 -1
- package/dist/ShareViaLink.cjs.js +0 -1512
- package/dist/ShareViaLink.cjs.js.map +0 -1
- package/dist/ShareViaLink.js +0 -1486
- package/dist/ShareViaLink.js.map +0 -1
- package/dist/Sidebar.cjs.js +0 -34985
- package/dist/Sidebar.cjs.js.map +0 -1
- package/dist/Sidebar.js +0 -34959
- package/dist/Sidebar.js.map +0 -1
- package/dist/SubHeader.cjs.js +0 -283
- package/dist/SubHeader.cjs.js.map +0 -1
- package/dist/SubHeader.js +0 -276
- package/dist/SubHeader.js.map +0 -1
- package/dist/TableWrapper.cjs.js +0 -87
- package/dist/TableWrapper.cjs.js.map +0 -1
- package/dist/TableWrapper.js +0 -81
- package/dist/TableWrapper.js.map +0 -1
- package/dist/ThemeSidebar.cjs.js +0 -13705
- package/dist/ThemeSidebar.cjs.js.map +0 -1
- package/dist/ThemeSidebar.js +0 -13680
- package/dist/ThemeSidebar.js.map +0 -1
- package/dist/TimeFormat.cjs.js +0 -53
- package/dist/TimeFormat.cjs.js.map +0 -1
- package/dist/TimeFormat.js +0 -47
- package/dist/TimeFormat.js.map +0 -1
- package/dist/TimezoneMismatchModal.cjs.js +0 -176
- package/dist/TimezoneMismatchModal.cjs.js.map +0 -1
- package/dist/TimezoneMismatchModal.js +0 -168
- package/dist/TimezoneMismatchModal.js.map +0 -1
- package/dist/ToggleFeatureCard.cjs.js +0 -389
- package/dist/ToggleFeatureCard.cjs.js.map +0 -1
- package/dist/ToggleFeatureCard.js +0 -383
- package/dist/ToggleFeatureCard.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
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;
|
|
@@ -0,0 +1,118 @@
|
|
|
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;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 };
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|