@bigbinary/neeto-molecules 1.1.78 → 1.2.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -52
- package/dist/Breadcrumbs.js +16 -19
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BrowserSupport.js +41 -138
- package/dist/BrowserSupport.js.map +1 -1
- package/dist/Builder.js +207 -364
- package/dist/Builder.js.map +1 -1
- package/dist/CalendarView.js +40 -288
- package/dist/CalendarView.js.map +1 -1
- package/dist/Chevron-c64ff676.js +190 -0
- package/dist/Chevron-c64ff676.js.map +1 -0
- package/dist/Codeblock.js +26 -209
- package/dist/Codeblock.js.map +1 -1
- package/dist/Columns.js +16 -240
- package/dist/Columns.js.map +1 -1
- package/dist/ConfigurePageSidebar.js +97 -0
- package/dist/ConfigurePageSidebar.js.map +1 -0
- package/dist/ConfirmationModal.js +10 -10
- package/dist/ConfirmationModal.js.map +1 -1
- package/dist/Container.js +5 -1187
- package/dist/Container.js.map +1 -1
- package/dist/CopyToClipboardButton.js +26 -155
- package/dist/CopyToClipboardButton.js.map +1 -1
- package/dist/Currency.js +912 -0
- package/dist/Currency.js.map +1 -0
- package/dist/CustomDomain.js +37 -633
- package/dist/CustomDomain.js.map +1 -1
- package/dist/CustomDomainDashboard.js +69 -2192
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/DateFormat.js +6 -20
- package/dist/DateFormat.js.map +1 -1
- package/dist/DateRangeFilter.js +19 -75
- package/dist/DateRangeFilter.js.map +1 -1
- package/dist/DeleteArchiveModal.js +86 -0
- package/dist/DeleteArchiveModal.js.map +1 -0
- package/dist/DocumentEditor.js +43 -133
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/DownloadMobileAppCallout.js +4 -4
- package/dist/DownloadMobileAppCallout.js.map +1 -1
- package/dist/DynamicVariables.js +12 -95
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailForm.js +79 -1741
- package/dist/EmailForm.js.map +1 -1
- package/dist/EmailPreview.js +32 -1213
- package/dist/EmailPreview.js.map +1 -1
- package/dist/EmojiPicker.js +67 -0
- package/dist/EmojiPicker.js.map +1 -0
- package/dist/EmojiReactions.js +69 -0
- package/dist/EmojiReactions.js.map +1 -0
- package/dist/ErrorPage.js +17 -26
- package/dist/ErrorPage.js.map +1 -1
- package/dist/FloatingActionMenu.js +646 -0
- package/dist/FloatingActionMenu.js.map +1 -0
- package/dist/Header.js +45 -117
- package/dist/Header.js.map +1 -1
- package/dist/HelpPopover.js +73 -0
- package/dist/HelpPopover.js.map +1 -0
- package/dist/IconPicker.js +36 -129
- package/dist/IconPicker.js.map +1 -1
- package/dist/ImageWithFallback.js +8 -144
- package/dist/ImageWithFallback.js.map +1 -1
- package/dist/InlineInput.js +22 -526
- package/dist/InlineInput.js.map +1 -1
- package/dist/Insights.js +304 -0
- package/dist/Insights.js.map +1 -0
- package/dist/IntegrationCard.js +42 -226
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IntegrationDisconnectAlert.js +6 -48
- package/dist/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/IntegrationWalkthroughModal.js +10 -10
- package/dist/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/IpRestriction.js +74 -221
- package/dist/IpRestriction.js.map +1 -1
- package/dist/KeyboardShortcuts.js +38 -128
- package/dist/KeyboardShortcuts.js.map +1 -1
- package/dist/LoginPage.js +39 -459
- package/dist/LoginPage.js.map +1 -1
- package/dist/MadeWith.js +32 -0
- package/dist/MadeWith.js.map +1 -0
- package/dist/MenuBar.js +34 -1295
- package/dist/MenuBar.js.map +1 -1
- package/dist/Metadata.js +65 -86
- package/dist/Metadata.js.map +1 -1
- package/dist/MoreDropdown.js +48 -107
- package/dist/MoreDropdown.js.map +1 -1
- package/dist/NavigationHeader.js +51 -730
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/NeetoWidget.js +148 -316
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Onboarding.js +343 -0
- package/dist/Onboarding.js.map +1 -0
- package/dist/OptionFields.js +507 -0
- package/dist/OptionFields.js.map +1 -0
- package/dist/PageLoader.js +5 -48
- package/dist/PageLoader.js.map +1 -1
- package/dist/PhoneNumber.js +122 -201
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/ProductEmbed.js +767 -0
- package/dist/ProductEmbed.js.map +1 -0
- package/dist/PublishBlock.js +19 -60
- package/dist/PublishBlock.js.map +1 -1
- package/dist/PublishYourItem.js +52 -0
- package/dist/PublishYourItem.js.map +1 -0
- package/dist/Rename.js +127 -394
- package/dist/Rename.js.map +1 -1
- package/dist/ResponsiveDevicePicker.js +7 -143
- package/dist/ResponsiveDevicePicker.js.map +1 -1
- package/dist/Schedule.js +131 -365
- package/dist/Schedule.js.map +1 -1
- package/dist/Scrollable.js +6 -89
- package/dist/Scrollable.js.map +1 -1
- package/dist/Search.js +54 -157
- package/dist/Search.js.map +1 -1
- package/dist/Security.js +72 -1567
- package/dist/Security.js.map +1 -1
- package/dist/SendToFields.js +51 -133
- package/dist/SendToFields.js.map +1 -1
- package/dist/Settings.js +141 -412
- package/dist/Settings.js.map +1 -1
- package/dist/ShareRecordingPane.js +189 -0
- package/dist/ShareRecordingPane.js.map +1 -0
- package/dist/ShareViaEmail.js +126 -551
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/ShareViaLink.js +127 -345
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/Sidebar.js +161 -758
- package/dist/Sidebar.js.map +1 -1
- package/dist/SubHeader.js +63 -108
- package/dist/SubHeader.js.map +1 -1
- package/dist/SuffixedInput.js +105 -0
- package/dist/SuffixedInput.js.map +1 -0
- package/dist/TableWrapper.js +8 -9
- package/dist/TableWrapper.js.map +1 -1
- package/dist/Taxonomy.js +112 -1774
- package/dist/Taxonomy.js.map +1 -1
- package/dist/ThemeSidebar.js +159 -776
- package/dist/ThemeSidebar.js.map +1 -1
- package/dist/TimeFormat.js +8 -44
- package/dist/TimeFormat.js.map +1 -1
- package/dist/TimezoneMismatchModal.js +49 -84
- package/dist/TimezoneMismatchModal.js.map +1 -1
- package/dist/ToggleFeatureCard.js +46 -169
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/dist/cjs/Breadcrumbs.js +49 -0
- package/dist/cjs/Breadcrumbs.js.map +1 -0
- package/dist/cjs/BrowserSupport.js +329 -0
- package/dist/cjs/BrowserSupport.js.map +1 -0
- package/dist/cjs/Builder.js +556 -0
- package/dist/cjs/Builder.js.map +1 -0
- package/dist/cjs/CalendarView.js +299 -0
- package/dist/cjs/CalendarView.js.map +1 -0
- package/dist/cjs/Chevron-8a4ed9cd.js +203 -0
- package/dist/cjs/Chevron-8a4ed9cd.js.map +1 -0
- package/dist/cjs/Codeblock.js +58 -0
- package/dist/cjs/Codeblock.js.map +1 -0
- package/dist/cjs/Columns.js +31 -0
- package/dist/cjs/Columns.js.map +1 -0
- package/dist/cjs/ConfigurePageSidebar.js +104 -0
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/ConfirmationModal.js +120 -0
- package/dist/cjs/ConfirmationModal.js.map +1 -0
- package/dist/cjs/Container.js +36 -0
- package/dist/cjs/Container.js.map +1 -0
- package/dist/cjs/CopyToClipboardButton.js +86 -0
- package/dist/cjs/CopyToClipboardButton.js.map +1 -0
- package/dist/cjs/Currency.js +921 -0
- package/dist/cjs/Currency.js.map +1 -0
- package/dist/cjs/CustomDomain.js +125 -0
- package/dist/cjs/CustomDomain.js.map +1 -0
- package/dist/cjs/CustomDomainDashboard.js +200 -0
- package/dist/cjs/CustomDomainDashboard.js.map +1 -0
- package/dist/cjs/DateFormat.js +40 -0
- package/dist/cjs/DateFormat.js.map +1 -0
- package/dist/cjs/DateRangeFilter.js +180 -0
- package/dist/cjs/DateRangeFilter.js.map +1 -0
- package/dist/cjs/DeleteArchiveModal.js +92 -0
- package/dist/cjs/DeleteArchiveModal.js.map +1 -0
- package/dist/cjs/DocumentEditor.js +194 -0
- package/dist/cjs/DocumentEditor.js.map +1 -0
- package/dist/cjs/DownloadMobileAppCallout.js +45 -0
- package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
- package/dist/cjs/DynamicVariables.js +106 -0
- package/dist/cjs/DynamicVariables.js.map +1 -0
- package/dist/cjs/EmailForm.js +395 -0
- package/dist/cjs/EmailForm.js.map +1 -0
- package/dist/cjs/EmailPreview.js +139 -0
- package/dist/cjs/EmailPreview.js.map +1 -0
- package/dist/cjs/EmojiPicker.js +75 -0
- package/dist/cjs/EmojiPicker.js.map +1 -0
- package/dist/cjs/EmojiReactions.js +76 -0
- package/dist/cjs/EmojiReactions.js.map +1 -0
- package/dist/cjs/ErrorPage.js +179 -0
- package/dist/cjs/ErrorPage.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +675 -0
- package/dist/cjs/FloatingActionMenu.js.map +1 -0
- package/dist/cjs/Header.js +104 -0
- package/dist/cjs/Header.js.map +1 -0
- package/dist/cjs/HelpPopover.js +80 -0
- package/dist/cjs/HelpPopover.js.map +1 -0
- package/dist/cjs/IconPicker.js +228 -0
- package/dist/cjs/IconPicker.js.map +1 -0
- package/dist/cjs/ImageWithFallback.js +52 -0
- package/dist/cjs/ImageWithFallback.js.map +1 -0
- package/dist/cjs/InlineInput.js +233 -0
- package/dist/cjs/InlineInput.js.map +1 -0
- package/dist/cjs/Insights.js +310 -0
- package/dist/cjs/Insights.js.map +1 -0
- package/dist/cjs/IntegrationCard.js +208 -0
- package/dist/cjs/IntegrationCard.js.map +1 -0
- package/dist/cjs/IntegrationDisconnectAlert.js +48 -0
- package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/cjs/IntegrationWalkthroughModal.js +51 -0
- package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/cjs/IpRestriction.js +525 -0
- package/dist/cjs/IpRestriction.js.map +1 -0
- package/dist/cjs/KeyboardShortcuts.js +282 -0
- package/dist/cjs/KeyboardShortcuts.js.map +1 -0
- package/dist/cjs/LoginPage.js +198 -0
- package/dist/cjs/LoginPage.js.map +1 -0
- package/dist/cjs/MadeWith.js +38 -0
- package/dist/cjs/MadeWith.js.map +1 -0
- package/dist/cjs/MenuBar.js +208 -0
- package/dist/cjs/MenuBar.js.map +1 -0
- package/dist/cjs/Metadata.js +195 -0
- package/dist/cjs/Metadata.js.map +1 -0
- package/dist/cjs/MoreDropdown.js +152 -0
- package/dist/cjs/MoreDropdown.js.map +1 -0
- package/dist/cjs/NavigationHeader.js +177 -0
- package/dist/cjs/NavigationHeader.js.map +1 -0
- package/dist/cjs/NeetoWidget.js +912 -0
- package/dist/cjs/NeetoWidget.js.map +1 -0
- package/dist/cjs/Onboarding.js +357 -0
- package/dist/cjs/Onboarding.js.map +1 -0
- package/dist/cjs/OptionFields.js +514 -0
- package/dist/cjs/OptionFields.js.map +1 -0
- package/dist/cjs/PageLoader.js +116 -0
- package/dist/cjs/PageLoader.js.map +1 -0
- package/dist/cjs/PhoneNumber.js +363 -0
- package/dist/cjs/PhoneNumber.js.map +1 -0
- package/dist/cjs/ProductEmbed.js +774 -0
- package/dist/cjs/ProductEmbed.js.map +1 -0
- package/dist/cjs/PublishBlock.js +125 -0
- package/dist/cjs/PublishBlock.js.map +1 -0
- package/dist/cjs/PublishYourItem.js +59 -0
- package/dist/cjs/PublishYourItem.js.map +1 -0
- package/dist/cjs/Rename.js +350 -0
- package/dist/cjs/Rename.js.map +1 -0
- package/dist/cjs/ResponsiveDevicePicker.js +64 -0
- package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
- package/dist/cjs/Schedule.js +889 -0
- package/dist/cjs/Schedule.js.map +1 -0
- package/dist/cjs/Scrollable.js +46 -0
- package/dist/cjs/Scrollable.js.map +1 -0
- package/dist/cjs/Search.js +117 -0
- package/dist/cjs/Search.js.map +1 -0
- package/dist/cjs/Security.js +376 -0
- package/dist/cjs/Security.js.map +1 -0
- package/dist/cjs/SendToFields.js +272 -0
- package/dist/cjs/SendToFields.js.map +1 -0
- package/dist/cjs/Settings.js +214 -0
- package/dist/cjs/Settings.js.map +1 -0
- package/dist/cjs/ShareRecordingPane.js +195 -0
- package/dist/cjs/ShareRecordingPane.js.map +1 -0
- package/dist/cjs/ShareViaEmail.js +348 -0
- package/dist/cjs/ShareViaEmail.js.map +1 -0
- package/dist/cjs/ShareViaLink.js +507 -0
- package/dist/cjs/ShareViaLink.js.map +1 -0
- package/dist/cjs/Sidebar.js +288 -0
- package/dist/cjs/Sidebar.js.map +1 -0
- package/dist/cjs/SubHeader.js +178 -0
- package/dist/cjs/SubHeader.js.map +1 -0
- package/dist/cjs/SuffixedInput.js +111 -0
- package/dist/cjs/SuffixedInput.js.map +1 -0
- package/dist/cjs/TableWrapper.js +32 -0
- package/dist/cjs/TableWrapper.js.map +1 -0
- package/dist/cjs/Taxonomy.js +442 -0
- package/dist/cjs/Taxonomy.js.map +1 -0
- package/dist/cjs/ThemeSidebar.js +1436 -0
- package/dist/cjs/ThemeSidebar.js.map +1 -0
- package/dist/cjs/TimeFormat.js +15 -0
- package/dist/cjs/TimeFormat.js.map +1 -0
- package/dist/cjs/TimezoneMismatchModal.js +143 -0
- package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
- package/dist/cjs/ToggleFeatureCard.js +209 -0
- package/dist/cjs/ToggleFeatureCard.js.map +1 -0
- package/dist/cjs/defineProperty-886ed289.js +47 -0
- package/dist/cjs/defineProperty-886ed289.js.map +1 -0
- package/dist/cjs/extends-1b35a664.js +19 -0
- package/dist/cjs/extends-1b35a664.js.map +1 -0
- package/dist/cjs/index-00fdb8c2.js +542 -0
- package/dist/cjs/index-00fdb8c2.js.map +1 -0
- package/dist/cjs/index-248c4f4c.js +1186 -0
- package/dist/cjs/index-248c4f4c.js.map +1 -0
- package/dist/cjs/index-c55ad2bc.js +375 -0
- package/dist/cjs/index-c55ad2bc.js.map +1 -0
- package/dist/cjs/inject-css-80a5faa3.js +6 -0
- package/dist/cjs/inject-css-80a5faa3.js.map +1 -0
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
- package/dist/cjs/slicedToArray-f320d9e7.js +61 -0
- package/dist/cjs/slicedToArray-f320d9e7.js.map +1 -0
- package/dist/cjs/toConsumableArray-9abb3858.js +22 -0
- package/dist/cjs/toConsumableArray-9abb3858.js.map +1 -0
- package/dist/cjs/useColumns-a1c3668f.js +271 -0
- package/dist/cjs/useColumns-a1c3668f.js.map +1 -0
- package/dist/defineProperty-549061a7.js +43 -0
- package/dist/defineProperty-549061a7.js.map +1 -0
- package/dist/extends-093996c9.js +17 -0
- package/dist/extends-093996c9.js.map +1 -0
- package/dist/index-90c89467.js +509 -0
- package/dist/index-90c89467.js.map +1 -0
- package/dist/index-9720867c.js +372 -0
- package/dist/index-9720867c.js.map +1 -0
- package/dist/index-e5588516.js +1184 -0
- package/dist/index-e5588516.js.map +1 -0
- package/dist/inject-css-c86de496.js +4 -0
- package/dist/inject-css-c86de496.js.map +1 -0
- package/dist/objectWithoutProperties-a0edb288.js +31 -0
- package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
- package/dist/slicedToArray-b4278ecd.js +57 -0
- package/dist/slicedToArray-b4278ecd.js.map +1 -0
- package/dist/toConsumableArray-1cc38429.js +20 -0
- package/dist/toConsumableArray-1cc38429.js.map +1 -0
- package/dist/useColumns-d17d1f72.js +258 -0
- package/dist/useColumns-d17d1f72.js.map +1 -0
- package/package.json +29 -17
- package/src/translations/de.json +7 -0
- package/src/translations/en.json +191 -31
- package/src/translations/es.json +7 -0
- package/src/translations/fr.json +7 -0
- package/src/translations/nl.json +7 -0
- package/src/translations/pl.json +7 -0
- package/src/translations/pt.json +7 -0
- package/types/Breadcrumbs.d.ts +1 -0
- package/types/Builder.d.ts +61 -12
- package/types/Columns.d.ts +112 -5
- package/types/ConfigurePageSidebar.d.ts +43 -0
- package/types/CopyToClipboardButton.d.ts +3 -0
- package/types/Currency.d.ts +48 -0
- package/types/CustomDomain.d.ts +2 -0
- package/types/CustomDomainDashboard.d.ts +14 -0
- package/types/DateRangeFilter.d.ts +2 -0
- package/types/DeleteArchiveModal.d.ts +60 -0
- package/types/EmailForm.d.ts +1 -1
- package/types/EmojiPicker.d.ts +33 -0
- package/types/EmojiReactions.d.ts +60 -0
- package/types/ErrorPage.d.ts +1 -0
- package/types/FloatingActionMenu.d.ts +56 -0
- package/types/Header.d.ts +2 -1
- package/types/HelpPopover.d.ts +42 -0
- package/types/Insights.d.ts +108 -0
- package/types/IntegrationCard.d.ts +2 -0
- package/types/KeyboardShortcuts.d.ts +2 -2
- package/types/MadeWith.d.ts +16 -0
- package/types/MoreDropdown.d.ts +4 -1
- package/types/NavigationHeader.d.ts +3 -1
- package/types/Onboarding.d.ts +63 -0
- package/types/OptionFields.d.ts +63 -0
- package/types/PhoneNumber.d.ts +6 -2
- package/types/ProductEmbed.d.ts +43 -0
- package/types/Rename.d.ts +4 -1
- package/types/Schedule.d.ts +2 -0
- package/types/Search.d.ts +2 -0
- package/types/Settings.d.ts +13 -10
- package/types/ShareRecordingPane.d.ts +50 -0
- package/types/ShareViaLink.d.ts +15 -4
- package/types/Sidebar.d.ts +16 -32
- package/types/SubHeader.d.ts +0 -1
- package/types/SuffixedInput.d.ts +43 -0
- package/types/ToggleFeatureCard.d.ts +8 -1
|
@@ -1,152 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { _ as _extends } from './extends-093996c9.js';
|
|
2
|
+
import { _ as _defineProperty } from './defineProperty-549061a7.js';
|
|
3
|
+
import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
|
|
4
|
+
import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
|
|
5
|
+
import React__default, { useState, useEffect } from 'react';
|
|
2
6
|
import classnames from 'classnames';
|
|
3
7
|
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
for (var key in source) {
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function _typeof(o) {
|
|
20
|
-
"@babel/helpers - typeof";
|
|
21
|
-
|
|
22
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
23
|
-
return typeof o;
|
|
24
|
-
} : function (o) {
|
|
25
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
26
|
-
}, _typeof(o);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function _toPrimitive(input, hint) {
|
|
30
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
31
|
-
var prim = input[Symbol.toPrimitive];
|
|
32
|
-
if (prim !== undefined) {
|
|
33
|
-
var res = prim.call(input, hint || "default");
|
|
34
|
-
if (_typeof(res) !== "object") return res;
|
|
35
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
36
|
-
}
|
|
37
|
-
return (hint === "string" ? String : Number)(input);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _toPropertyKey(arg) {
|
|
41
|
-
var key = _toPrimitive(arg, "string");
|
|
42
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _defineProperty(obj, key, value) {
|
|
46
|
-
key = _toPropertyKey(key);
|
|
47
|
-
if (key in obj) {
|
|
48
|
-
Object.defineProperty(obj, key, {
|
|
49
|
-
value: value,
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
obj[key] = value;
|
|
56
|
-
}
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _arrayWithHoles(arr) {
|
|
61
|
-
if (Array.isArray(arr)) return arr;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _iterableToArrayLimit(r, l) {
|
|
65
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
66
|
-
if (null != t) {
|
|
67
|
-
var e,
|
|
68
|
-
n,
|
|
69
|
-
i,
|
|
70
|
-
u,
|
|
71
|
-
a = [],
|
|
72
|
-
f = !0,
|
|
73
|
-
o = !1;
|
|
74
|
-
try {
|
|
75
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
76
|
-
if (Object(t) !== t) return;
|
|
77
|
-
f = !1;
|
|
78
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
79
|
-
} catch (r) {
|
|
80
|
-
o = !0, n = r;
|
|
81
|
-
} finally {
|
|
82
|
-
try {
|
|
83
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
84
|
-
} finally {
|
|
85
|
-
if (o) throw n;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return a;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _arrayLikeToArray(arr, len) {
|
|
93
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
94
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
95
|
-
return arr2;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
99
|
-
if (!o) return;
|
|
100
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
101
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
102
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
103
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
104
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function _nonIterableRest() {
|
|
108
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function _slicedToArray(arr, i) {
|
|
112
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
116
|
-
if (source == null) return {};
|
|
117
|
-
var target = {};
|
|
118
|
-
var sourceKeys = Object.keys(source);
|
|
119
|
-
var key, i;
|
|
120
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
121
|
-
key = sourceKeys[i];
|
|
122
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
123
|
-
target[key] = source[key];
|
|
124
|
-
}
|
|
125
|
-
return target;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _objectWithoutProperties(source, excluded) {
|
|
129
|
-
if (source == null) return {};
|
|
130
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
131
|
-
var key, i;
|
|
132
|
-
if (Object.getOwnPropertySymbols) {
|
|
133
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
134
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
135
|
-
key = sourceSymbolKeys[i];
|
|
136
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
137
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
138
|
-
target[key] = source[key];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return target;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
8
|
var _excluded$1 = ["className"];
|
|
145
9
|
var ImagePlaceholder = function ImagePlaceholder(_ref) {
|
|
146
10
|
var _ref$className = _ref.className,
|
|
147
11
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
148
12
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
149
|
-
return /*#__PURE__*/
|
|
13
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
150
14
|
"data-testid": "fallback-image",
|
|
151
15
|
className: classnames("neeto-ui-bg-gray-100", _defineProperty({}, className, className))
|
|
152
16
|
}, props));
|
|
@@ -170,11 +34,11 @@ var ImageWithFallback = function ImageWithFallback(_ref) {
|
|
|
170
34
|
};
|
|
171
35
|
img.src = src;
|
|
172
36
|
}, [src]);
|
|
173
|
-
return isLoaded ? /*#__PURE__*/
|
|
37
|
+
return isLoaded ? /*#__PURE__*/React__default.createElement("img", _extends({
|
|
174
38
|
"data-testid": "original-image"
|
|
175
39
|
}, _objectSpread({
|
|
176
40
|
src: src
|
|
177
|
-
}, otherProps))) : /*#__PURE__*/
|
|
41
|
+
}, otherProps))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, fallback || /*#__PURE__*/React__default.createElement(ImagePlaceholder, otherProps));
|
|
178
42
|
};
|
|
179
43
|
|
|
180
44
|
export { ImageWithFallback as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageWithFallback.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/ImageWithFallback/ImagePlaceholder.jsx","../src/components/ImageWithFallback/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import React from \"react\";\n\nimport classnames from \"classnames\";\n\nconst ImagePlaceholder = ({ className = \"\", ...props }) => (\n <div\n data-testid=\"fallback-image\"\n className={classnames(\"neeto-ui-bg-gray-100\", {\n [className]: className,\n })}\n {...props}\n />\n);\n\nexport default ImagePlaceholder;\n","import React, { useEffect, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport ImagePlaceholder from \"./ImagePlaceholder\";\n\nconst ImageWithFallback = ({ src, fallback, ...otherProps }) => {\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n const img = new Image();\n img.onload = () => {\n setIsLoaded(true);\n };\n img.src = src;\n }, [src]);\n\n return isLoaded ? (\n <img data-testid=\"original-image\" {...{ src, ...otherProps }} />\n ) : (\n <>{fallback || <ImagePlaceholder {...otherProps} />}</>\n );\n};\n\nImageWithFallback.propTypes = {\n /**\n * The provide the source of the image.\n */\n src: PropTypes.string,\n /**\n * Displays a fallback component in case no image is available.\n */\n fallback: PropTypes.node,\n};\n\nexport default ImageWithFallback;\n"],"names":["toPrimitive","toPropertyKey","arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","objectWithoutPropertiesLoose","ImagePlaceholder","_ref","_ref$className","className","props","_objectWithoutProperties","_excluded","React","createElement","_extends","classnames","_defineProperty","ImageWithFallback","src","fallback","otherProps","_useState","useState","_useState2","_slicedToArray","isLoaded","setIsLoaded","useE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back/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\n\nconst ImagePlaceholder = ({ className = \"\", ...props }) => (\n <div\n data-testid=\"fallback-image\"\n className={classnames(\"neeto-ui-bg-gray-100\", {\n [className]: className,\n })}\n {...props}\n />\n);\n\nexport default ImagePlaceholder;\n","import React, { useEffect, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport ImagePlaceholder from \"./ImagePlaceholder\";\n\nconst ImageWithFallback = ({ src, fallback, ...otherProps }) => {\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n const img = new Image();\n img.onload = () => {\n setIsLoaded(true);\n };\n img.src = src;\n }, [src]);\n\n return isLoaded ? (\n <img data-testid=\"original-image\" {...{ src, ...otherProps }} />\n ) : (\n <>{fallback || <ImagePlaceholder {...otherProps} />}</>\n );\n};\n\nImageWithFallback.propTypes = {\n /**\n * The provide the source of the image.\n */\n src: PropTypes.string,\n /**\n * Displays a fallback component in case no image is available.\n */\n fallback: PropTypes.node,\n};\n\nexport default ImageWithFallback;\n"],"names":["ImagePlaceholder","_ref","_ref$className","className","props","_objectWithoutProperties","_excluded","React","createElement","_extends","classnames","_defineProperty","ImageWithFallback","src","fallback","otherProps","_useState","useState","_useState2","_slicedToArray","isLoaded","setIsLoaded","useEffect","img","Image","onload","_objectSpread","Fragment"],"mappings":";;;;;;;;AAIA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAAME,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;AAAKE,IAAAA,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,WAAA,CAAA,CAAA;AAAA,EAAA,oBAClDC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,CAAA;AACE,IAAA,aAAA,EAAY,gBAAgB;IAC5BN,SA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