@bigbinary/neeto-molecules 3.15.42 → 3.15.43
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/package.json +1 -1
- package/dist/AuditLogs.js +0 -539
- package/dist/AuditLogs.js.map +0 -1
- package/dist/BoardView.js +0 -394
- package/dist/BoardView.js.map +0 -1
- package/dist/Breadcrumbs.js +0 -46
- package/dist/Breadcrumbs.js.map +0 -1
- package/dist/BrowserPreview.js +0 -50
- package/dist/BrowserPreview.js.map +0 -1
- package/dist/BrowserSupport.js +0 -348
- package/dist/BrowserSupport.js.map +0 -1
- package/dist/Builder.js +0 -786
- package/dist/Builder.js.map +0 -1
- package/dist/ButtonGroup.js +0 -36
- package/dist/ButtonGroup.js.map +0 -1
- package/dist/CalendarView.js +0 -353
- package/dist/CalendarView.js.map +0 -1
- package/dist/CardLayout.js +0 -49
- package/dist/CardLayout.js.map +0 -1
- package/dist/Chevron-6dLkaXtR.js +0 -246
- package/dist/Chevron-6dLkaXtR.js.map +0 -1
- package/dist/Codeblock.js +0 -58
- package/dist/Codeblock.js.map +0 -1
- package/dist/Columns.js +0 -21
- package/dist/Columns.js.map +0 -1
- package/dist/ConfigurePageSidebar.js +0 -97
- package/dist/ConfigurePageSidebar.js.map +0 -1
- package/dist/ConfirmationModal.js +0 -110
- package/dist/ConfirmationModal.js.map +0 -1
- package/dist/Container.js +0 -38
- package/dist/Container.js.map +0 -1
- package/dist/CopyToClipboardButton.js +0 -82
- package/dist/CopyToClipboardButton.js.map +0 -1
- package/dist/Currency.js +0 -917
- package/dist/Currency.js.map +0 -1
- package/dist/DateFormat.js +0 -45
- package/dist/DateFormat.js.map +0 -1
- package/dist/DateRangeFilter.js +0 -178
- package/dist/DateRangeFilter.js.map +0 -1
- package/dist/DeleteArchiveModal.js +0 -98
- package/dist/DeleteArchiveModal.js.map +0 -1
- package/dist/DeviceIncompatibilityMessage.js +0 -95
- package/dist/DeviceIncompatibilityMessage.js.map +0 -1
- package/dist/DocumentEditor.js +0 -183
- package/dist/DocumentEditor.js.map +0 -1
- package/dist/DownloadMobileAppCallout.js +0 -40
- package/dist/DownloadMobileAppCallout.js.map +0 -1
- package/dist/DynamicVariables.js +0 -115
- package/dist/DynamicVariables.js.map +0 -1
- package/dist/EmailForm.js +0 -567
- package/dist/EmailForm.js.map +0 -1
- package/dist/EmailPreview.js +0 -140
- package/dist/EmailPreview.js.map +0 -1
- package/dist/EmojiPicker.js +0 -112
- package/dist/EmojiPicker.js.map +0 -1
- package/dist/EmojiReactions.js +0 -82
- package/dist/EmojiReactions.js.map +0 -1
- package/dist/Engagements.js +0 -292
- package/dist/Engagements.js.map +0 -1
- package/dist/ErrorPage.js +0 -1811
- package/dist/ErrorPage.js.map +0 -1
- package/dist/FileUpload.js +0 -595
- package/dist/FileUpload.js.map +0 -1
- package/dist/FinderModal.js +0 -280
- package/dist/FinderModal.js.map +0 -1
- package/dist/FloatingActionMenu.js +0 -854
- package/dist/FloatingActionMenu.js.map +0 -1
- package/dist/GoogleFontPicker.js +0 -581
- package/dist/GoogleFontPicker.js.map +0 -1
- package/dist/Header.js +0 -126
- package/dist/Header.js.map +0 -1
- package/dist/HelpPopover.js +0 -83
- package/dist/HelpPopover.js.map +0 -1
- package/dist/IconPicker.js +0 -1159
- package/dist/IconPicker.js.map +0 -1
- package/dist/ImageWithFallback.js +0 -49
- package/dist/ImageWithFallback.js.map +0 -1
- package/dist/InlineInput.js +0 -230
- package/dist/InlineInput.js.map +0 -1
- package/dist/Insights.js +0 -358
- package/dist/Insights.js.map +0 -1
- package/dist/IntegrationCard.js +0 -227
- package/dist/IntegrationCard.js.map +0 -1
- package/dist/IpRestriction.js +0 -3617
- package/dist/IpRestriction.js.map +0 -1
- package/dist/KeyboardShortcuts.js +0 -284
- package/dist/KeyboardShortcuts.js.map +0 -1
- package/dist/LoginPage.js +0 -184
- package/dist/LoginPage.js.map +0 -1
- package/dist/MadeWith.js +0 -41
- package/dist/MadeWith.js.map +0 -1
- package/dist/MenuBar.js +0 -1326
- package/dist/MenuBar.js.map +0 -1
- package/dist/Metadata.js +0 -218
- package/dist/Metadata.js.map +0 -1
- package/dist/MobilePreviewHeader.js +0 -25
- package/dist/MobilePreviewHeader.js.map +0 -1
- package/dist/MoreDropdown.js +0 -163
- package/dist/MoreDropdown.js.map +0 -1
- package/dist/NavigationHeader.js +0 -264
- package/dist/NavigationHeader.js.map +0 -1
- package/dist/NeetoWidget.js +0 -2867
- package/dist/NeetoWidget.js.map +0 -1
- package/dist/Onboarding.js +0 -246
- package/dist/Onboarding.js.map +0 -1
- package/dist/OptionFields.js +0 -717
- package/dist/OptionFields.js.map +0 -1
- package/dist/PageLoader.js +0 -40
- package/dist/PageLoader.js.map +0 -1
- package/dist/PhoneNumber.js +0 -75
- package/dist/PhoneNumber.js.map +0 -1
- package/dist/ProductEmbed.js +0 -884
- package/dist/ProductEmbed.js.map +0 -1
- package/dist/PublishBlock.js +0 -447
- package/dist/PublishBlock.js.map +0 -1
- package/dist/PublishYourItem.js +0 -58
- package/dist/PublishYourItem.js.map +0 -1
- package/dist/Rename.js +0 -366
- package/dist/Rename.js.map +0 -1
- package/dist/ResponsiveDevicePicker.js +0 -63
- package/dist/ResponsiveDevicePicker.js.map +0 -1
- package/dist/Schedule.js +0 -926
- package/dist/Schedule.js.map +0 -1
- package/dist/Scrollable.js +0 -42
- package/dist/Scrollable.js.map +0 -1
- package/dist/Search.js +0 -110
- package/dist/Search.js.map +0 -1
- package/dist/SendToFields.js +0 -2221
- package/dist/SendToFields.js.map +0 -1
- package/dist/SessionEnvironment.js +0 -431
- package/dist/SessionEnvironment.js.map +0 -1
- package/dist/Settings.js +0 -250
- package/dist/Settings.js.map +0 -1
- package/dist/ShareRecordingPane.js +0 -216
- package/dist/ShareRecordingPane.js.map +0 -1
- package/dist/ShareViaEmail.js +0 -416
- package/dist/ShareViaEmail.js.map +0 -1
- package/dist/ShareViaLink.js +0 -1556
- package/dist/ShareViaLink.js.map +0 -1
- package/dist/Sidebar.js +0 -294
- package/dist/Sidebar.js.map +0 -1
- package/dist/StatusDropdown.js +0 -109
- package/dist/StatusDropdown.js.map +0 -1
- package/dist/StickyRibbonsContainer.js +0 -131
- package/dist/StickyRibbonsContainer.js.map +0 -1
- package/dist/SubHeader.js +0 -209
- package/dist/SubHeader.js.map +0 -1
- package/dist/SubscriptionNotificationsContainer.js +0 -77
- package/dist/SubscriptionNotificationsContainer.js.map +0 -1
- package/dist/SuffixedInput.js +0 -111
- package/dist/SuffixedInput.js.map +0 -1
- package/dist/TableWrapper.js +0 -27
- package/dist/TableWrapper.js.map +0 -1
- package/dist/Taxonomy.js +0 -496
- package/dist/Taxonomy.js.map +0 -1
- package/dist/TimeFormat.js +0 -14
- package/dist/TimeFormat.js.map +0 -1
- package/dist/TimezoneMismatchModal.js +0 -138
- package/dist/TimezoneMismatchModal.js.map +0 -1
- package/dist/ToggleFeatureCard.js +0 -211
- package/dist/ToggleFeatureCard.js.map +0 -1
- package/dist/_commonjsHelpers-BFTU3MAI.js +0 -8
- package/dist/_commonjsHelpers-BFTU3MAI.js.map +0 -1
- package/dist/cjs/AuditLogs.js +0 -541
- package/dist/cjs/AuditLogs.js.map +0 -1
- package/dist/cjs/BoardView.js +0 -396
- package/dist/cjs/BoardView.js.map +0 -1
- package/dist/cjs/Breadcrumbs.js +0 -48
- package/dist/cjs/Breadcrumbs.js.map +0 -1
- package/dist/cjs/BrowserPreview.js +0 -52
- package/dist/cjs/BrowserPreview.js.map +0 -1
- package/dist/cjs/BrowserSupport.js +0 -350
- package/dist/cjs/BrowserSupport.js.map +0 -1
- package/dist/cjs/Builder.js +0 -794
- package/dist/cjs/Builder.js.map +0 -1
- package/dist/cjs/ButtonGroup.js +0 -38
- package/dist/cjs/ButtonGroup.js.map +0 -1
- package/dist/cjs/CalendarView.js +0 -355
- package/dist/cjs/CalendarView.js.map +0 -1
- package/dist/cjs/CardLayout.js +0 -51
- package/dist/cjs/CardLayout.js.map +0 -1
- package/dist/cjs/Chevron-wfVdaB4-.js +0 -256
- package/dist/cjs/Chevron-wfVdaB4-.js.map +0 -1
- package/dist/cjs/Codeblock.js +0 -60
- package/dist/cjs/Codeblock.js.map +0 -1
- package/dist/cjs/Columns.js +0 -35
- package/dist/cjs/Columns.js.map +0 -1
- package/dist/cjs/ConfigurePageSidebar.js +0 -99
- package/dist/cjs/ConfigurePageSidebar.js.map +0 -1
- package/dist/cjs/ConfirmationModal.js +0 -131
- package/dist/cjs/ConfirmationModal.js.map +0 -1
- package/dist/cjs/Container.js +0 -40
- package/dist/cjs/Container.js.map +0 -1
- package/dist/cjs/CopyToClipboardButton.js +0 -84
- package/dist/cjs/CopyToClipboardButton.js.map +0 -1
- package/dist/cjs/Currency.js +0 -920
- package/dist/cjs/Currency.js.map +0 -1
- package/dist/cjs/DateFormat.js +0 -47
- package/dist/cjs/DateFormat.js.map +0 -1
- package/dist/cjs/DateRangeFilter.js +0 -180
- package/dist/cjs/DateRangeFilter.js.map +0 -1
- package/dist/cjs/DeleteArchiveModal.js +0 -100
- package/dist/cjs/DeleteArchiveModal.js.map +0 -1
- package/dist/cjs/DeviceIncompatibilityMessage.js +0 -115
- package/dist/cjs/DeviceIncompatibilityMessage.js.map +0 -1
- package/dist/cjs/DocumentEditor.js +0 -185
- package/dist/cjs/DocumentEditor.js.map +0 -1
- package/dist/cjs/DownloadMobileAppCallout.js +0 -42
- package/dist/cjs/DownloadMobileAppCallout.js.map +0 -1
- package/dist/cjs/DynamicVariables.js +0 -117
- package/dist/cjs/DynamicVariables.js.map +0 -1
- package/dist/cjs/EmailForm.js +0 -593
- package/dist/cjs/EmailForm.js.map +0 -1
- package/dist/cjs/EmailPreview.js +0 -142
- package/dist/cjs/EmailPreview.js.map +0 -1
- package/dist/cjs/EmojiPicker.js +0 -114
- package/dist/cjs/EmojiPicker.js.map +0 -1
- package/dist/cjs/EmojiReactions.js +0 -84
- package/dist/cjs/EmojiReactions.js.map +0 -1
- package/dist/cjs/Engagements.js +0 -294
- package/dist/cjs/Engagements.js.map +0 -1
- package/dist/cjs/ErrorPage.js +0 -1831
- package/dist/cjs/ErrorPage.js.map +0 -1
- package/dist/cjs/FileUpload.js +0 -598
- package/dist/cjs/FileUpload.js.map +0 -1
- package/dist/cjs/FinderModal.js +0 -282
- package/dist/cjs/FinderModal.js.map +0 -1
- package/dist/cjs/FloatingActionMenu.js +0 -875
- package/dist/cjs/FloatingActionMenu.js.map +0 -1
- package/dist/cjs/GoogleFontPicker.js +0 -583
- package/dist/cjs/GoogleFontPicker.js.map +0 -1
- package/dist/cjs/Header.js +0 -128
- package/dist/cjs/Header.js.map +0 -1
- package/dist/cjs/HelpPopover.js +0 -85
- package/dist/cjs/HelpPopover.js.map +0 -1
- package/dist/cjs/IconPicker.js +0 -1161
- package/dist/cjs/IconPicker.js.map +0 -1
- package/dist/cjs/ImageWithFallback.js +0 -51
- package/dist/cjs/ImageWithFallback.js.map +0 -1
- package/dist/cjs/InlineInput.js +0 -233
- package/dist/cjs/InlineInput.js.map +0 -1
- package/dist/cjs/Insights.js +0 -360
- package/dist/cjs/Insights.js.map +0 -1
- package/dist/cjs/IntegrationCard.js +0 -229
- package/dist/cjs/IntegrationCard.js.map +0 -1
- package/dist/cjs/IpRestriction.js +0 -3638
- package/dist/cjs/IpRestriction.js.map +0 -1
- package/dist/cjs/KeyboardShortcuts.js +0 -286
- package/dist/cjs/KeyboardShortcuts.js.map +0 -1
- package/dist/cjs/LoginPage.js +0 -205
- package/dist/cjs/LoginPage.js.map +0 -1
- package/dist/cjs/MadeWith.js +0 -43
- package/dist/cjs/MadeWith.js.map +0 -1
- package/dist/cjs/MenuBar.js +0 -1328
- package/dist/cjs/MenuBar.js.map +0 -1
- package/dist/cjs/Metadata.js +0 -220
- package/dist/cjs/Metadata.js.map +0 -1
- package/dist/cjs/MobilePreviewHeader.js +0 -27
- package/dist/cjs/MobilePreviewHeader.js.map +0 -1
- package/dist/cjs/MoreDropdown.js +0 -165
- package/dist/cjs/MoreDropdown.js.map +0 -1
- package/dist/cjs/NavigationHeader.js +0 -266
- package/dist/cjs/NavigationHeader.js.map +0 -1
- package/dist/cjs/NeetoWidget.js +0 -2888
- package/dist/cjs/NeetoWidget.js.map +0 -1
- package/dist/cjs/Onboarding.js +0 -248
- package/dist/cjs/Onboarding.js.map +0 -1
- package/dist/cjs/OptionFields.js +0 -719
- package/dist/cjs/OptionFields.js.map +0 -1
- package/dist/cjs/PageLoader.js +0 -42
- package/dist/cjs/PageLoader.js.map +0 -1
- package/dist/cjs/PhoneNumber.js +0 -80
- package/dist/cjs/PhoneNumber.js.map +0 -1
- package/dist/cjs/ProductEmbed.js +0 -886
- package/dist/cjs/ProductEmbed.js.map +0 -1
- package/dist/cjs/PublishBlock.js +0 -449
- package/dist/cjs/PublishBlock.js.map +0 -1
- package/dist/cjs/PublishYourItem.js +0 -60
- package/dist/cjs/PublishYourItem.js.map +0 -1
- package/dist/cjs/Rename.js +0 -368
- package/dist/cjs/Rename.js.map +0 -1
- package/dist/cjs/ResponsiveDevicePicker.js +0 -65
- package/dist/cjs/ResponsiveDevicePicker.js.map +0 -1
- package/dist/cjs/Schedule.js +0 -947
- package/dist/cjs/Schedule.js.map +0 -1
- package/dist/cjs/Scrollable.js +0 -44
- package/dist/cjs/Scrollable.js.map +0 -1
- package/dist/cjs/Search.js +0 -112
- package/dist/cjs/Search.js.map +0 -1
- package/dist/cjs/SendToFields.js +0 -2223
- package/dist/cjs/SendToFields.js.map +0 -1
- package/dist/cjs/SessionEnvironment.js +0 -433
- package/dist/cjs/SessionEnvironment.js.map +0 -1
- package/dist/cjs/Settings.js +0 -252
- package/dist/cjs/Settings.js.map +0 -1
- package/dist/cjs/ShareRecordingPane.js +0 -218
- package/dist/cjs/ShareRecordingPane.js.map +0 -1
- package/dist/cjs/ShareViaEmail.js +0 -437
- package/dist/cjs/ShareViaEmail.js.map +0 -1
- package/dist/cjs/ShareViaLink.js +0 -1577
- package/dist/cjs/ShareViaLink.js.map +0 -1
- package/dist/cjs/Sidebar.js +0 -315
- package/dist/cjs/Sidebar.js.map +0 -1
- package/dist/cjs/StatusDropdown.js +0 -111
- package/dist/cjs/StatusDropdown.js.map +0 -1
- package/dist/cjs/StickyRibbonsContainer.js +0 -133
- package/dist/cjs/StickyRibbonsContainer.js.map +0 -1
- package/dist/cjs/SubHeader.js +0 -211
- package/dist/cjs/SubHeader.js.map +0 -1
- package/dist/cjs/SubscriptionNotificationsContainer.js +0 -79
- package/dist/cjs/SubscriptionNotificationsContainer.js.map +0 -1
- package/dist/cjs/SuffixedInput.js +0 -113
- package/dist/cjs/SuffixedInput.js.map +0 -1
- package/dist/cjs/TableWrapper.js +0 -29
- package/dist/cjs/TableWrapper.js.map +0 -1
- package/dist/cjs/Taxonomy.js +0 -517
- package/dist/cjs/Taxonomy.js.map +0 -1
- package/dist/cjs/TimeFormat.js +0 -16
- package/dist/cjs/TimeFormat.js.map +0 -1
- package/dist/cjs/TimezoneMismatchModal.js +0 -140
- package/dist/cjs/TimezoneMismatchModal.js.map +0 -1
- package/dist/cjs/ToggleFeatureCard.js +0 -213
- package/dist/cjs/ToggleFeatureCard.js.map +0 -1
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -11
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +0 -1
- package/dist/cjs/index-JY2zVpnv.js +0 -1189
- package/dist/cjs/index-JY2zVpnv.js.map +0 -1
- package/dist/cjs/inject-css-vQvjPR2x.js +0 -6
- package/dist/cjs/inject-css-vQvjPR2x.js.map +0 -1
- package/dist/cjs/phone-number-BN-c0rfv.js +0 -320
- package/dist/cjs/phone-number-BN-c0rfv.js.map +0 -1
- package/dist/cjs/platform-BUcCb8Jx.js +0 -1254
- package/dist/cjs/platform-BUcCb8Jx.js.map +0 -1
- package/dist/cjs/useColumns-BP8c4PV-.js +0 -282
- package/dist/cjs/useColumns-BP8c4PV-.js.map +0 -1
- package/dist/index-DAYCJu79.js +0 -1187
- package/dist/index-DAYCJu79.js.map +0 -1
- package/dist/inject-css-DmrvuTKK.js +0 -4
- package/dist/inject-css-DmrvuTKK.js.map +0 -1
- package/dist/phone-number-CXCBroLh.js +0 -295
- package/dist/phone-number-CXCBroLh.js.map +0 -1
- package/dist/platform-F44zJ4Xh.js +0 -1252
- package/dist/platform-F44zJ4Xh.js.map +0 -1
- package/dist/styles/page-loader.css +0 -1
- package/dist/styles/page-loader.js +0 -3
- package/dist/useColumns-Db5uic1-.js +0 -274
- package/dist/useColumns-Db5uic1-.js.map +0 -1
- package/types/AuditLogs.d.ts +0 -22
- package/types/BoardView.d.ts +0 -149
- package/types/Breadcrumbs.d.ts +0 -30
- package/types/BrowserPreview.d.ts +0 -30
- package/types/BrowserSupport.d.ts +0 -110
- package/types/Builder.d.ts +0 -99
- package/types/ButtonGroup.d.ts +0 -45
- package/types/CalendarView.d.ts +0 -98
- package/types/CardLayout.d.ts +0 -34
- package/types/Codeblock.d.ts +0 -37
- package/types/Columns.d.ts +0 -168
- package/types/ConfigurePageSidebar.d.ts +0 -45
- package/types/ConfirmationModal.d.ts +0 -65
- package/types/Container.d.ts +0 -38
- package/types/CopyToClipboardButton.d.ts +0 -28
- package/types/Currency.d.ts +0 -50
- package/types/DateFormat.d.ts +0 -15
- package/types/DateRangeFilter.d.ts +0 -56
- package/types/DeleteArchiveModal.d.ts +0 -65
- package/types/DeviceIncompatibilityMessage.d.ts +0 -19
- package/types/DocumentEditor.d.ts +0 -61
- package/types/DownloadMobileAppCallout.d.ts +0 -35
- package/types/DynamicVariables.d.ts +0 -48
- package/types/EmailForm.d.ts +0 -165
- package/types/EmailFormProvider.d.ts +0 -48
- package/types/EmailPreview.d.ts +0 -43
- package/types/EmojiPicker.d.ts +0 -35
- package/types/EmojiReactions.d.ts +0 -62
- package/types/Engagements.d.ts +0 -131
- package/types/ErrorPage.d.ts +0 -22
- package/types/FileUpload.d.ts +0 -89
- package/types/FinderModal.d.ts +0 -66
- package/types/FloatingActionMenu.d.ts +0 -59
- package/types/GoogleFontPicker.d.ts +0 -68
- package/types/Header.d.ts +0 -37
- package/types/HelpPopover.d.ts +0 -45
- package/types/IconPicker.d.ts +0 -45
- package/types/ImageWithFallback.d.ts +0 -24
- package/types/InlineInput.d.ts +0 -87
- package/types/Insights.d.ts +0 -112
- package/types/IntegrationCard.d.ts +0 -60
- package/types/IpRestriction.d.ts +0 -25
- package/types/KeyboardShortcuts.d.ts +0 -149
- package/types/LoginPage.d.ts +0 -45
- package/types/MadeWith.d.ts +0 -18
- package/types/MenuBar.d.ts +0 -127
- package/types/Metadata.d.ts +0 -109
- package/types/MobilePreviewHeader.d.ts +0 -19
- package/types/MoreDropdown.d.ts +0 -52
- package/types/NavigationHeader.d.ts +0 -180
- package/types/NeetoWidget.d.ts +0 -43
- package/types/Onboarding.d.ts +0 -70
- package/types/OptionFields.d.ts +0 -70
- package/types/PageLoader.d.ts +0 -40
- package/types/PhoneNumber.d.ts +0 -112
- package/types/ProductEmbed.d.ts +0 -93
- package/types/PublishBlock.d.ts +0 -148
- package/types/Rename.d.ts +0 -73
- package/types/ResponsiveDevicePicker.d.ts +0 -32
- package/types/Schedule.d.ts +0 -146
- package/types/Scrollable.d.ts +0 -30
- package/types/Search.d.ts +0 -22
- package/types/SendToFields.d.ts +0 -67
- package/types/SessionEnvironment.d.ts +0 -170
- package/types/Settings.d.ts +0 -108
- package/types/ShareRecordingPane.d.ts +0 -85
- package/types/ShareViaEmail.d.ts +0 -99
- package/types/ShareViaLink.d.ts +0 -183
- package/types/Sidebar.d.ts +0 -51
- package/types/StatusDropdown.d.ts +0 -74
- package/types/StickyRibbonsContainer.d.ts +0 -28
- package/types/SubHeader.d.ts +0 -105
- package/types/SubscriptionNotificationsContainer.d.ts +0 -26
- package/types/SuffixedInput.d.ts +0 -45
- package/types/TableWrapper.d.ts +0 -40
- package/types/Taxonomy.d.ts +0 -59
- package/types/TimeFormat.d.ts +0 -13
- package/types/TimezoneMismatchModal.d.ts +0 -41
- package/types/ToggleFeatureCard.d.ts +0 -38
package/dist/ShareViaLink.js
DELETED
|
@@ -1,1556 +0,0 @@
|
|
|
1
|
-
import { isPresent, slugify, noop } from '@bigbinary/neeto-cist';
|
|
2
|
-
import { omit } from 'ramda';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
5
|
-
import { useTranslation, Trans } from 'react-i18next';
|
|
6
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
8
|
-
import React__default, { useRef, useCallback, useEffect, useState, createElement } from 'react';
|
|
9
|
-
import ExternalLink from '@bigbinary/neeto-icons/ExternalLink';
|
|
10
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
11
|
-
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
12
|
-
import MoreDropdown from './MoreDropdown.js';
|
|
13
|
-
import { Formik, Form } from 'formik';
|
|
14
|
-
import Pane from '@bigbinary/neetoui/Pane';
|
|
15
|
-
import Input from '@bigbinary/neetoui/formik/Input';
|
|
16
|
-
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
17
|
-
import { t } from 'i18next';
|
|
18
|
-
import Facebook from '@bigbinary/neeto-icons/Facebook';
|
|
19
|
-
import Linkedin from '@bigbinary/neeto-icons/Linkedin';
|
|
20
|
-
import Twitter from '@bigbinary/neeto-icons/Twitter';
|
|
21
|
-
import * as yup from 'yup';
|
|
22
|
-
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
23
|
-
import { n } from './inject-css-DmrvuTKK.js';
|
|
24
|
-
import { dayjs } from '@bigbinary/neeto-commons-frontend/utils';
|
|
25
|
-
import Help from '@bigbinary/neeto-icons/Help';
|
|
26
|
-
import Modal from '@bigbinary/neetoui/Modal';
|
|
27
|
-
import Input$1 from '@bigbinary/neetoui/Input';
|
|
28
|
-
import Select from '@bigbinary/neetoui/Select';
|
|
29
|
-
import DatePicker from '@bigbinary/neetoui/DatePicker';
|
|
30
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
31
|
-
import { Link as Link$1 } from 'react-router-dom';
|
|
32
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
33
|
-
import '@bigbinary/neeto-icons/Copy';
|
|
34
|
-
import '@bigbinary/neeto-icons/Check';
|
|
35
|
-
import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
36
|
-
import '@bigbinary/neeto-icons/MenuVertical';
|
|
37
|
-
import '@bigbinary/neetoui/Dropdown';
|
|
38
|
-
import '@bigbinary/neetoui/Tooltip';
|
|
39
|
-
|
|
40
|
-
var ExpiryNotice = function ExpiryNotice(_ref) {
|
|
41
|
-
var expiryConfiguration = _ref.expiryConfiguration;
|
|
42
|
-
var _useTranslation = useTranslation(),
|
|
43
|
-
t = _useTranslation.t;
|
|
44
|
-
var daysBeforeExpiry = expiryConfiguration.daysBeforeExpiry;
|
|
45
|
-
var notice = t("neetoMolecules.shareViaLink.expiryNotice.daysRemaining", {
|
|
46
|
-
count: daysBeforeExpiry
|
|
47
|
-
});
|
|
48
|
-
if (daysBeforeExpiry < 1) {
|
|
49
|
-
notice = t("neetoMolecules.shareViaLink.expiryNotice.expiresToday");
|
|
50
|
-
}
|
|
51
|
-
if (daysBeforeExpiry <= 0) {
|
|
52
|
-
notice = t("neetoMolecules.shareViaLink.expiryNotice.expired");
|
|
53
|
-
}
|
|
54
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
55
|
-
"data-testid": "expiry-notice",
|
|
56
|
-
lineHeight: "normal",
|
|
57
|
-
style: "body3",
|
|
58
|
-
className: classnames("ml-1", {
|
|
59
|
-
"neeto-ui-text-error-800": daysBeforeExpiry <= 1,
|
|
60
|
-
"neeto-ui-text-gray-700": daysBeforeExpiry > 1
|
|
61
|
-
}),
|
|
62
|
-
children: notice
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
var facebookShareLink = function facebookShareLink(_ref) {
|
|
67
|
-
var url = _ref.url;
|
|
68
|
-
return buildUrl("https://www.facebook.com/sharer/sharer.php", {
|
|
69
|
-
u: url
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
var linkedInShareLink = function linkedInShareLink(_ref2) {
|
|
73
|
-
var url = _ref2.url,
|
|
74
|
-
title = _ref2.title;
|
|
75
|
-
return buildUrl("https://www.linkedin.com/sharing/share-offsite", {
|
|
76
|
-
mini: true,
|
|
77
|
-
text: "".concat(title, " ").concat(url)
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
var twitterShareLink = function twitterShareLink(_ref3) {
|
|
81
|
-
var url = _ref3.url,
|
|
82
|
-
title = _ref3.title;
|
|
83
|
-
return buildUrl("http://twitter.com/share", {
|
|
84
|
-
text: title,
|
|
85
|
-
url: url
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
var downloadCanvas = function downloadCanvas(canvas) {
|
|
89
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
90
|
-
var _options$name = options.name,
|
|
91
|
-
name = _options$name === void 0 ? "image" : _options$name,
|
|
92
|
-
_options$extension = options.extension,
|
|
93
|
-
extension = _options$extension === void 0 ? "png" : _options$extension;
|
|
94
|
-
var canvasUrl = canvas.toDataURL("image/".concat(extension));
|
|
95
|
-
var element = document.createElement("a");
|
|
96
|
-
element.href = canvasUrl;
|
|
97
|
-
element.download = "".concat(name, ".").concat(extension);
|
|
98
|
-
element.click();
|
|
99
|
-
element.remove();
|
|
100
|
-
};
|
|
101
|
-
var getPathname = function getPathname(url) {
|
|
102
|
-
return new URL(url).pathname.slice(1);
|
|
103
|
-
};
|
|
104
|
-
var getPrefixFromUrl = function getPrefixFromUrl(url) {
|
|
105
|
-
return "".concat(new URL(url).origin, "/");
|
|
106
|
-
};
|
|
107
|
-
var truncatePrefix = function truncatePrefix(inputElement, prefixText) {
|
|
108
|
-
var parentElement = inputElement.parentElement;
|
|
109
|
-
var prefixElement = parentElement.querySelector(".neeto-ui-input__prefix");
|
|
110
|
-
var _getComputedStyle = getComputedStyle(inputElement),
|
|
111
|
-
fontSize = _getComputedStyle.fontSize;
|
|
112
|
-
var averageCharWidth = parseFloat(fontSize) * 0.6;
|
|
113
|
-
var requiredInputWidth = inputElement.value.length * averageCharWidth;
|
|
114
|
-
var prefixWidth = parentElement.offsetWidth - requiredInputWidth;
|
|
115
|
-
var maxPrefixChars = Math.max(Math.floor(prefixWidth / averageCharWidth), 5);
|
|
116
|
-
prefixElement.textContent = maxPrefixChars < prefixText.length ? "...".concat(prefixText.slice(-maxPrefixChars)) : prefixText;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
var SOCIAL_MEDIA_OPTIONS = {
|
|
120
|
-
FACEBOOK: {
|
|
121
|
-
label: t("neetoMolecules.shareViaLink.socialMediaShare.facebook"),
|
|
122
|
-
icon: Facebook,
|
|
123
|
-
generateShareUrl: facebookShareLink
|
|
124
|
-
},
|
|
125
|
-
LINKEDIN: {
|
|
126
|
-
label: t("neetoMolecules.shareViaLink.socialMediaShare.linkedIn"),
|
|
127
|
-
icon: Linkedin,
|
|
128
|
-
generateShareUrl: linkedInShareLink
|
|
129
|
-
},
|
|
130
|
-
TWITTER: {
|
|
131
|
-
label: t("neetoMolecules.shareViaLink.socialMediaShare.twitter"),
|
|
132
|
-
icon: Twitter,
|
|
133
|
-
generateShareUrl: twitterShareLink
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
var PATH_VALIDATION_SCHEMA = yup.object().shape({
|
|
137
|
-
path: yup.string().required(t("neetoMolecules.shareViaLink.editUrl.validationError")).matches(/^[A-Za-z0-9]([\w/-])*$/, t("neetoMolecules.shareViaLink.editUrl.validationError"))
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
var css = ".no-padding .neeto-ui-input.neeto-ui-input--medium input{padding:0}.no-padding .neeto-ui-input__prefix{color:rgb(var(--neeto-ui-gray-600))!important}";
|
|
141
|
-
n(css,{});
|
|
142
|
-
|
|
143
|
-
var Header = Pane.Header,
|
|
144
|
-
Body = Pane.Body,
|
|
145
|
-
Footer = Pane.Footer;
|
|
146
|
-
var EditURL = function EditURL(_ref) {
|
|
147
|
-
var editUrlProps = _ref.editUrlProps,
|
|
148
|
-
isOpen = _ref.isOpen,
|
|
149
|
-
onClose = _ref.onClose,
|
|
150
|
-
url = _ref.url,
|
|
151
|
-
isLoading = _ref.isLoading,
|
|
152
|
-
handleEdit = _ref.handleEdit;
|
|
153
|
-
var _useTranslation = useTranslation(),
|
|
154
|
-
t = _useTranslation.t;
|
|
155
|
-
var focusRef = useRef(null);
|
|
156
|
-
var prevIsLoadingRef = useRef(isLoading);
|
|
157
|
-
var prefixText = (editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.prefix) || getPrefixFromUrl(url);
|
|
158
|
-
var observerRef = useRef(new ResizeObserver(function (_ref2) {
|
|
159
|
-
var _ref3 = _slicedToArray(_ref2, 1),
|
|
160
|
-
entry = _ref3[0];
|
|
161
|
-
return requestAnimationFrame(function () {
|
|
162
|
-
return truncatePrefix(entry.target, prefixText);
|
|
163
|
-
});
|
|
164
|
-
}));
|
|
165
|
-
var inputRef = useCallback(function (inputElement) {
|
|
166
|
-
focusRef.current = inputElement;
|
|
167
|
-
inputElement ? observerRef.current.observe(inputElement) : observerRef.current.disconnect();
|
|
168
|
-
}, []);
|
|
169
|
-
useEffect(function () {
|
|
170
|
-
if (prevIsLoadingRef.current && !isLoading) onClose();
|
|
171
|
-
prevIsLoadingRef.current = isLoading;
|
|
172
|
-
}, [isLoading]);
|
|
173
|
-
return /*#__PURE__*/jsxs(Pane, {
|
|
174
|
-
isOpen: isOpen,
|
|
175
|
-
onClose: onClose,
|
|
176
|
-
"data-testid": "edit-url-modal",
|
|
177
|
-
initialFocusRef: focusRef,
|
|
178
|
-
size: "large",
|
|
179
|
-
children: [/*#__PURE__*/jsx(Header, {
|
|
180
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
181
|
-
lineHeight: "normal",
|
|
182
|
-
style: "h2",
|
|
183
|
-
weight: "semibold",
|
|
184
|
-
children: t("neetoMolecules.shareViaLink.editUrl.title")
|
|
185
|
-
})
|
|
186
|
-
}), /*#__PURE__*/jsx(Formik, {
|
|
187
|
-
enableReinitialize: true,
|
|
188
|
-
initialValues: {
|
|
189
|
-
path: (editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.editablePath) || getPathname(url)
|
|
190
|
-
},
|
|
191
|
-
validationSchema: PATH_VALIDATION_SCHEMA,
|
|
192
|
-
onSubmit: function onSubmit(_ref4) {
|
|
193
|
-
var path = _ref4.path;
|
|
194
|
-
return handleEdit(path);
|
|
195
|
-
},
|
|
196
|
-
children: function children(_ref5) {
|
|
197
|
-
var isSubmitting = _ref5.isSubmitting,
|
|
198
|
-
dirty = _ref5.dirty;
|
|
199
|
-
return /*#__PURE__*/jsxs(Form, {
|
|
200
|
-
children: [/*#__PURE__*/jsxs(Body, {
|
|
201
|
-
className: "space-y-6",
|
|
202
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
203
|
-
className: "no-padding w-full flex-grow-0",
|
|
204
|
-
"data-testid": "edit-url-input",
|
|
205
|
-
label: t("neetoMolecules.shareViaLink.editUrl.inputLabel"),
|
|
206
|
-
maxLength: editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.maxLength,
|
|
207
|
-
name: "path",
|
|
208
|
-
prefix: prefixText,
|
|
209
|
-
ref: inputRef
|
|
210
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
211
|
-
className: "neeto-ui-text-gray-700",
|
|
212
|
-
lineHeight: "normal",
|
|
213
|
-
style: "body2",
|
|
214
|
-
children: t("neetoMolecules.shareViaLink.editUrl.description")
|
|
215
|
-
})]
|
|
216
|
-
}), /*#__PURE__*/jsx(Footer, {
|
|
217
|
-
className: "space-x-2",
|
|
218
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
219
|
-
className: "flex items-center space-x-2",
|
|
220
|
-
cancelButtonProps: {
|
|
221
|
-
onClick: onClose,
|
|
222
|
-
disabled: isSubmitting,
|
|
223
|
-
"data-testid": "edit-url-cancel-button"
|
|
224
|
-
},
|
|
225
|
-
submitButtonProps: {
|
|
226
|
-
disabled: isSubmitting || !dirty,
|
|
227
|
-
loading: isLoading,
|
|
228
|
-
"data-testid": "edit-url-confirm-button"
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
})]
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
})]
|
|
235
|
-
});
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
var RegenerateURL = function RegenerateURL(_ref) {
|
|
239
|
-
var _regenerateConfig$exp, _regenerateConfig$exp2, _globalProps$user$dat, _globalProps;
|
|
240
|
-
var isOpen = _ref.isOpen,
|
|
241
|
-
onClose = _ref.onClose,
|
|
242
|
-
url = _ref.url,
|
|
243
|
-
isLoading = _ref.isLoading,
|
|
244
|
-
handleRegenerate = _ref.handleRegenerate,
|
|
245
|
-
_ref$regenerateConfig = _ref.regenerateConfig,
|
|
246
|
-
regenerateConfig = _ref$regenerateConfig === void 0 ? {
|
|
247
|
-
expiresInOptions: [],
|
|
248
|
-
helpUrl: null
|
|
249
|
-
} : _ref$regenerateConfig;
|
|
250
|
-
var _useTranslation = useTranslation(),
|
|
251
|
-
t = _useTranslation.t;
|
|
252
|
-
var prevIsLoadingRef = useRef(isLoading);
|
|
253
|
-
var regenerateStrategy = isPresent(regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.expiresInOptions) ? "expiryBased" : "basic";
|
|
254
|
-
var defaultExpiresInOption = regenerateConfig === null || regenerateConfig === void 0 || (_regenerateConfig$exp = regenerateConfig.expiresInOptions) === null || _regenerateConfig$exp === void 0 || (_regenerateConfig$exp = _regenerateConfig$exp[0]) === null || _regenerateConfig$exp === void 0 ? void 0 : _regenerateConfig$exp.value;
|
|
255
|
-
var _useState = useState(defaultExpiresInOption),
|
|
256
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
257
|
-
selectedExpiresInOption = _useState2[0],
|
|
258
|
-
setSelectedExpiresInOption = _useState2[1];
|
|
259
|
-
var defaultExpiresOnDate = dayjs().add(10, "day").toDate();
|
|
260
|
-
var _useState3 = useState(defaultExpiresOnDate),
|
|
261
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
262
|
-
selectedExpiresOnDate = _useState4[0],
|
|
263
|
-
setSelectedExpiresOnDate = _useState4[1];
|
|
264
|
-
var isSelectedExpiresInOptionNever = selectedExpiresInOption === "never";
|
|
265
|
-
var isSelectedExpiresInOptionCustom = selectedExpiresInOption === "custom";
|
|
266
|
-
var isSelectedExpiresInOptionValidNumberOfDays = isPresent(selectedExpiresInOption) && !isSelectedExpiresInOptionCustom && !isSelectedExpiresInOptionNever;
|
|
267
|
-
var isValidExpiryConfig = isSelectedExpiresInOptionNever || isSelectedExpiresInOptionCustom && isPresent(selectedExpiresOnDate) || isSelectedExpiresInOptionValidNumberOfDays;
|
|
268
|
-
var expiryConfigPayload = isSelectedExpiresInOptionValidNumberOfDays ? {
|
|
269
|
-
expiresInDays: selectedExpiresInOption
|
|
270
|
-
} : {
|
|
271
|
-
expiresOnDate: selectedExpiresOnDate
|
|
272
|
-
};
|
|
273
|
-
var onSubmit = function onSubmit() {
|
|
274
|
-
return regenerateStrategy === "basic" || isSelectedExpiresInOptionNever ? handleRegenerate() : handleRegenerate({
|
|
275
|
-
payload: expiryConfigPayload
|
|
276
|
-
});
|
|
277
|
-
};
|
|
278
|
-
useEffect(function () {
|
|
279
|
-
if (prevIsLoadingRef.current && !isLoading) onClose();
|
|
280
|
-
prevIsLoadingRef.current = isLoading;
|
|
281
|
-
}, [isLoading]);
|
|
282
|
-
useEffect(function () {
|
|
283
|
-
if (!isOpen) return;
|
|
284
|
-
setSelectedExpiresInOption(defaultExpiresInOption);
|
|
285
|
-
setSelectedExpiresOnDate(defaultExpiresOnDate);
|
|
286
|
-
}, [isOpen]);
|
|
287
|
-
return /*#__PURE__*/jsxs(Modal, {
|
|
288
|
-
isOpen: isOpen,
|
|
289
|
-
onClose: onClose,
|
|
290
|
-
"data-testid": "regenerate-url-modal",
|
|
291
|
-
size: regenerateStrategy === "basic" ? "medium" : "large",
|
|
292
|
-
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
293
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
294
|
-
lineHeight: "normal",
|
|
295
|
-
style: "h2",
|
|
296
|
-
weight: "semibold",
|
|
297
|
-
children: regenerateStrategy === "expiryBased" ? t("neetoMolecules.shareViaLink.regenerateUrl.titleForExpiryBasedRegeneration") : t("neetoMolecules.shareViaLink.regenerateUrl.title")
|
|
298
|
-
})
|
|
299
|
-
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
300
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
301
|
-
className: "w-full space-y-6",
|
|
302
|
-
children: [regenerateStrategy === "basic" && /*#__PURE__*/jsx(Input$1, {
|
|
303
|
-
disabled: true,
|
|
304
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.inputLabel"),
|
|
305
|
-
value: url
|
|
306
|
-
}), regenerateStrategy === "expiryBased" && /*#__PURE__*/jsxs("div", {
|
|
307
|
-
className: "flex flex-row gap-2",
|
|
308
|
-
children: [/*#__PURE__*/jsx(Select, {
|
|
309
|
-
"data-testid": "expires-in-select",
|
|
310
|
-
defaultValue: (_regenerateConfig$exp2 = regenerateConfig.expiresInOptions) === null || _regenerateConfig$exp2 === void 0 ? void 0 : _regenerateConfig$exp2[0],
|
|
311
|
-
options: regenerateConfig.expiresInOptions,
|
|
312
|
-
className: classnames({
|
|
313
|
-
"w-1/2": isSelectedExpiresInOptionCustom,
|
|
314
|
-
"w-full": !isSelectedExpiresInOptionCustom
|
|
315
|
-
}),
|
|
316
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.expiresInLabel"),
|
|
317
|
-
labelProps: {
|
|
318
|
-
helpIconProps: isPresent(regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.helpUrl) && {
|
|
319
|
-
icon: Help,
|
|
320
|
-
className: "cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out",
|
|
321
|
-
popoverProps: {
|
|
322
|
-
title: t("neetoMolecules.shareViaLink.regenerateUrl.expiresInHelpTitle"),
|
|
323
|
-
helpLinkProps: {
|
|
324
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.helpLinkLabel"),
|
|
325
|
-
href: regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.helpUrl,
|
|
326
|
-
target: "_blank"
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
onChange: function onChange(option) {
|
|
332
|
-
return setSelectedExpiresInOption(option.value);
|
|
333
|
-
}
|
|
334
|
-
}), isSelectedExpiresInOptionCustom && /*#__PURE__*/jsx(DatePicker, {
|
|
335
|
-
"data-testid": "expires-on-date-picker",
|
|
336
|
-
dateFormat: (_globalProps$user$dat = (_globalProps = globalProps) === null || _globalProps === void 0 || (_globalProps = _globalProps.user) === null || _globalProps === void 0 ? void 0 : _globalProps.dateFormat) !== null && _globalProps$user$dat !== void 0 ? _globalProps$user$dat : undefined,
|
|
337
|
-
disabledDate: function disabledDate(d) {
|
|
338
|
-
return !d || d.isBefore(dayjs());
|
|
339
|
-
},
|
|
340
|
-
picker: "date",
|
|
341
|
-
type: "date",
|
|
342
|
-
value: selectedExpiresOnDate,
|
|
343
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.expiresOnLabel"),
|
|
344
|
-
onChange: setSelectedExpiresOnDate
|
|
345
|
-
})]
|
|
346
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
347
|
-
className: "neeto-ui-text-gray-700",
|
|
348
|
-
lineHeight: "normal",
|
|
349
|
-
style: "body2",
|
|
350
|
-
children: t("neetoMolecules.shareViaLink.regenerateUrl.description")
|
|
351
|
-
})]
|
|
352
|
-
})
|
|
353
|
-
}), /*#__PURE__*/jsxs(Modal.Footer, {
|
|
354
|
-
className: "space-x-2",
|
|
355
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
356
|
-
"data-cy": "regenerate-url-confirm-button",
|
|
357
|
-
"data-testid": "regenerate-url-confirm-button",
|
|
358
|
-
loading: isLoading,
|
|
359
|
-
disabled: regenerateStrategy === "expiryBased" && !isValidExpiryConfig,
|
|
360
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.submitButtonLabel"),
|
|
361
|
-
onClick: onSubmit
|
|
362
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
363
|
-
"data-cy": "regenerate-url-cancel-button",
|
|
364
|
-
"data-testid": "regenerate-url-cancel-button",
|
|
365
|
-
style: "text",
|
|
366
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.cancelButtonLabel"),
|
|
367
|
-
onClick: onClose
|
|
368
|
-
})]
|
|
369
|
-
})]
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
var Link = function Link(_ref) {
|
|
374
|
-
var editUrlProps = _ref.editUrlProps,
|
|
375
|
-
enabledOptions = _ref.enabledOptions,
|
|
376
|
-
entityName = _ref.entityName,
|
|
377
|
-
handleEdit = _ref.handleEdit,
|
|
378
|
-
handleRegenerate = _ref.handleRegenerate,
|
|
379
|
-
isLoading = _ref.isLoading,
|
|
380
|
-
previewUrl = _ref.previewUrl,
|
|
381
|
-
url = _ref.url;
|
|
382
|
-
var _useState = useState(false),
|
|
383
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
384
|
-
isRegenerateURLModalOpen = _useState2[0],
|
|
385
|
-
setIsRegenerateURLModalOpen = _useState2[1];
|
|
386
|
-
var _useState3 = useState(false),
|
|
387
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
388
|
-
isEditURLModalOpen = _useState4[0],
|
|
389
|
-
setIsEditURLModalOpen = _useState4[1];
|
|
390
|
-
var _useTranslation = useTranslation(),
|
|
391
|
-
t = _useTranslation.t;
|
|
392
|
-
var isDropdownEnabled = enabledOptions.regenerate || enabledOptions.edit;
|
|
393
|
-
return /*#__PURE__*/jsx("div", {
|
|
394
|
-
className: "space-y-4",
|
|
395
|
-
"data-cy": "link-block",
|
|
396
|
-
"data-testid": "link-block",
|
|
397
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
398
|
-
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-1",
|
|
399
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
400
|
-
className: "neeto-ui-rounded-md neeto-ui-border-gray-200 relative min-w-0 flex-grow truncate border p-2 leading-none",
|
|
401
|
-
"data-cy": "nui-input-field",
|
|
402
|
-
children: url
|
|
403
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
404
|
-
className: "flex w-full flex-shrink-0 items-center gap-1 sm:w-auto",
|
|
405
|
-
children: [/*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
406
|
-
"data-cy": "link-copy-button",
|
|
407
|
-
"data-testid": "link-copy-button",
|
|
408
|
-
label: t("neetoMolecules.shareViaLink.copyLink"),
|
|
409
|
-
value: url
|
|
410
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
411
|
-
"data-cy": "preview-button",
|
|
412
|
-
"data-testid": "preview-button",
|
|
413
|
-
href: previewUrl || url,
|
|
414
|
-
icon: ExternalLink,
|
|
415
|
-
style: "secondary",
|
|
416
|
-
target: "_blank",
|
|
417
|
-
tooltipProps: {
|
|
418
|
-
content: t("neetoMolecules.shareViaLink.view", {
|
|
419
|
-
entity: entityName
|
|
420
|
-
}),
|
|
421
|
-
position: "top",
|
|
422
|
-
touch: ["hold", 500]
|
|
423
|
-
}
|
|
424
|
-
}), isDropdownEnabled && /*#__PURE__*/jsxs(Fragment, {
|
|
425
|
-
children: [/*#__PURE__*/jsx(MoreDropdown, {
|
|
426
|
-
menuItems: [{
|
|
427
|
-
isVisible: enabledOptions.regenerate || isPresent(enabledOptions.regenerate),
|
|
428
|
-
"data-testid": "regenerate-url-button",
|
|
429
|
-
"data-cy": "regenerate-url-button",
|
|
430
|
-
onClick: function onClick() {
|
|
431
|
-
return setIsRegenerateURLModalOpen(true);
|
|
432
|
-
},
|
|
433
|
-
label: t("neetoMolecules.shareViaLink.regenerateUrl.title"),
|
|
434
|
-
key: "regenerate-url-option"
|
|
435
|
-
}, {
|
|
436
|
-
isVisible: enabledOptions.edit,
|
|
437
|
-
"data-testid": "edit-url-button",
|
|
438
|
-
"data-cy": "edit-url-button",
|
|
439
|
-
onClick: function onClick() {
|
|
440
|
-
return setIsEditURLModalOpen(true);
|
|
441
|
-
},
|
|
442
|
-
label: t("neetoMolecules.shareViaLink.editUrl.title"),
|
|
443
|
-
key: "edit-url-option"
|
|
444
|
-
}]
|
|
445
|
-
}), /*#__PURE__*/jsx(RegenerateURL, {
|
|
446
|
-
handleRegenerate: handleRegenerate,
|
|
447
|
-
isLoading: isLoading,
|
|
448
|
-
url: url,
|
|
449
|
-
isOpen: isRegenerateURLModalOpen,
|
|
450
|
-
regenerateConfig: enabledOptions.regenerate,
|
|
451
|
-
onClose: function onClose() {
|
|
452
|
-
return setIsRegenerateURLModalOpen(false);
|
|
453
|
-
}
|
|
454
|
-
}), /*#__PURE__*/jsx(EditURL, {
|
|
455
|
-
editUrlProps: editUrlProps,
|
|
456
|
-
handleEdit: handleEdit,
|
|
457
|
-
isLoading: isLoading,
|
|
458
|
-
url: url,
|
|
459
|
-
isOpen: isEditURLModalOpen,
|
|
460
|
-
onClose: function onClose() {
|
|
461
|
-
return setIsEditURLModalOpen(false);
|
|
462
|
-
}
|
|
463
|
-
})]
|
|
464
|
-
})]
|
|
465
|
-
})]
|
|
466
|
-
})
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
var __defProp = Object.defineProperty;
|
|
471
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
472
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
473
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
474
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
475
|
-
var __spreadValues = (a, b) => {
|
|
476
|
-
for (var prop in b || (b = {}))
|
|
477
|
-
if (__hasOwnProp.call(b, prop))
|
|
478
|
-
__defNormalProp(a, prop, b[prop]);
|
|
479
|
-
if (__getOwnPropSymbols)
|
|
480
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
481
|
-
if (__propIsEnum.call(b, prop))
|
|
482
|
-
__defNormalProp(a, prop, b[prop]);
|
|
483
|
-
}
|
|
484
|
-
return a;
|
|
485
|
-
};
|
|
486
|
-
var __objRest = (source, exclude) => {
|
|
487
|
-
var target = {};
|
|
488
|
-
for (var prop in source)
|
|
489
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
490
|
-
target[prop] = source[prop];
|
|
491
|
-
if (source != null && __getOwnPropSymbols)
|
|
492
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
493
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
494
|
-
target[prop] = source[prop];
|
|
495
|
-
}
|
|
496
|
-
return target;
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
// src/third-party/qrcodegen/index.ts
|
|
500
|
-
/**
|
|
501
|
-
* @license QR Code generator library (TypeScript)
|
|
502
|
-
* Copyright (c) Project Nayuki.
|
|
503
|
-
* SPDX-License-Identifier: MIT
|
|
504
|
-
*/
|
|
505
|
-
var qrcodegen;
|
|
506
|
-
((qrcodegen2) => {
|
|
507
|
-
const _QrCode = class {
|
|
508
|
-
constructor(version, errorCorrectionLevel, dataCodewords, msk) {
|
|
509
|
-
this.version = version;
|
|
510
|
-
this.errorCorrectionLevel = errorCorrectionLevel;
|
|
511
|
-
this.modules = [];
|
|
512
|
-
this.isFunction = [];
|
|
513
|
-
if (version < _QrCode.MIN_VERSION || version > _QrCode.MAX_VERSION)
|
|
514
|
-
throw new RangeError("Version value out of range");
|
|
515
|
-
if (msk < -1 || msk > 7)
|
|
516
|
-
throw new RangeError("Mask value out of range");
|
|
517
|
-
this.size = version * 4 + 17;
|
|
518
|
-
let row = [];
|
|
519
|
-
for (let i = 0; i < this.size; i++)
|
|
520
|
-
row.push(false);
|
|
521
|
-
for (let i = 0; i < this.size; i++) {
|
|
522
|
-
this.modules.push(row.slice());
|
|
523
|
-
this.isFunction.push(row.slice());
|
|
524
|
-
}
|
|
525
|
-
this.drawFunctionPatterns();
|
|
526
|
-
const allCodewords = this.addEccAndInterleave(dataCodewords);
|
|
527
|
-
this.drawCodewords(allCodewords);
|
|
528
|
-
if (msk == -1) {
|
|
529
|
-
let minPenalty = 1e9;
|
|
530
|
-
for (let i = 0; i < 8; i++) {
|
|
531
|
-
this.applyMask(i);
|
|
532
|
-
this.drawFormatBits(i);
|
|
533
|
-
const penalty = this.getPenaltyScore();
|
|
534
|
-
if (penalty < minPenalty) {
|
|
535
|
-
msk = i;
|
|
536
|
-
minPenalty = penalty;
|
|
537
|
-
}
|
|
538
|
-
this.applyMask(i);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
assert(0 <= msk && msk <= 7);
|
|
542
|
-
this.mask = msk;
|
|
543
|
-
this.applyMask(msk);
|
|
544
|
-
this.drawFormatBits(msk);
|
|
545
|
-
this.isFunction = [];
|
|
546
|
-
}
|
|
547
|
-
static encodeText(text, ecl) {
|
|
548
|
-
const segs = qrcodegen2.QrSegment.makeSegments(text);
|
|
549
|
-
return _QrCode.encodeSegments(segs, ecl);
|
|
550
|
-
}
|
|
551
|
-
static encodeBinary(data, ecl) {
|
|
552
|
-
const seg = qrcodegen2.QrSegment.makeBytes(data);
|
|
553
|
-
return _QrCode.encodeSegments([seg], ecl);
|
|
554
|
-
}
|
|
555
|
-
static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = true) {
|
|
556
|
-
if (!(_QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode.MAX_VERSION) || mask < -1 || mask > 7)
|
|
557
|
-
throw new RangeError("Invalid value");
|
|
558
|
-
let version;
|
|
559
|
-
let dataUsedBits;
|
|
560
|
-
for (version = minVersion; ; version++) {
|
|
561
|
-
const dataCapacityBits2 = _QrCode.getNumDataCodewords(version, ecl) * 8;
|
|
562
|
-
const usedBits = QrSegment.getTotalBits(segs, version);
|
|
563
|
-
if (usedBits <= dataCapacityBits2) {
|
|
564
|
-
dataUsedBits = usedBits;
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
if (version >= maxVersion)
|
|
568
|
-
throw new RangeError("Data too long");
|
|
569
|
-
}
|
|
570
|
-
for (const newEcl of [_QrCode.Ecc.MEDIUM, _QrCode.Ecc.QUARTILE, _QrCode.Ecc.HIGH]) {
|
|
571
|
-
if (boostEcl && dataUsedBits <= _QrCode.getNumDataCodewords(version, newEcl) * 8)
|
|
572
|
-
ecl = newEcl;
|
|
573
|
-
}
|
|
574
|
-
let bb = [];
|
|
575
|
-
for (const seg of segs) {
|
|
576
|
-
appendBits(seg.mode.modeBits, 4, bb);
|
|
577
|
-
appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);
|
|
578
|
-
for (const b of seg.getData())
|
|
579
|
-
bb.push(b);
|
|
580
|
-
}
|
|
581
|
-
assert(bb.length == dataUsedBits);
|
|
582
|
-
const dataCapacityBits = _QrCode.getNumDataCodewords(version, ecl) * 8;
|
|
583
|
-
assert(bb.length <= dataCapacityBits);
|
|
584
|
-
appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);
|
|
585
|
-
appendBits(0, (8 - bb.length % 8) % 8, bb);
|
|
586
|
-
assert(bb.length % 8 == 0);
|
|
587
|
-
for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17)
|
|
588
|
-
appendBits(padByte, 8, bb);
|
|
589
|
-
let dataCodewords = [];
|
|
590
|
-
while (dataCodewords.length * 8 < bb.length)
|
|
591
|
-
dataCodewords.push(0);
|
|
592
|
-
bb.forEach((b, i) => dataCodewords[i >>> 3] |= b << 7 - (i & 7));
|
|
593
|
-
return new _QrCode(version, ecl, dataCodewords, mask);
|
|
594
|
-
}
|
|
595
|
-
getModule(x, y) {
|
|
596
|
-
return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];
|
|
597
|
-
}
|
|
598
|
-
getModules() {
|
|
599
|
-
return this.modules;
|
|
600
|
-
}
|
|
601
|
-
drawFunctionPatterns() {
|
|
602
|
-
for (let i = 0; i < this.size; i++) {
|
|
603
|
-
this.setFunctionModule(6, i, i % 2 == 0);
|
|
604
|
-
this.setFunctionModule(i, 6, i % 2 == 0);
|
|
605
|
-
}
|
|
606
|
-
this.drawFinderPattern(3, 3);
|
|
607
|
-
this.drawFinderPattern(this.size - 4, 3);
|
|
608
|
-
this.drawFinderPattern(3, this.size - 4);
|
|
609
|
-
const alignPatPos = this.getAlignmentPatternPositions();
|
|
610
|
-
const numAlign = alignPatPos.length;
|
|
611
|
-
for (let i = 0; i < numAlign; i++) {
|
|
612
|
-
for (let j = 0; j < numAlign; j++) {
|
|
613
|
-
if (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))
|
|
614
|
-
this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
this.drawFormatBits(0);
|
|
618
|
-
this.drawVersion();
|
|
619
|
-
}
|
|
620
|
-
drawFormatBits(mask) {
|
|
621
|
-
const data = this.errorCorrectionLevel.formatBits << 3 | mask;
|
|
622
|
-
let rem = data;
|
|
623
|
-
for (let i = 0; i < 10; i++)
|
|
624
|
-
rem = rem << 1 ^ (rem >>> 9) * 1335;
|
|
625
|
-
const bits = (data << 10 | rem) ^ 21522;
|
|
626
|
-
assert(bits >>> 15 == 0);
|
|
627
|
-
for (let i = 0; i <= 5; i++)
|
|
628
|
-
this.setFunctionModule(8, i, getBit(bits, i));
|
|
629
|
-
this.setFunctionModule(8, 7, getBit(bits, 6));
|
|
630
|
-
this.setFunctionModule(8, 8, getBit(bits, 7));
|
|
631
|
-
this.setFunctionModule(7, 8, getBit(bits, 8));
|
|
632
|
-
for (let i = 9; i < 15; i++)
|
|
633
|
-
this.setFunctionModule(14 - i, 8, getBit(bits, i));
|
|
634
|
-
for (let i = 0; i < 8; i++)
|
|
635
|
-
this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));
|
|
636
|
-
for (let i = 8; i < 15; i++)
|
|
637
|
-
this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));
|
|
638
|
-
this.setFunctionModule(8, this.size - 8, true);
|
|
639
|
-
}
|
|
640
|
-
drawVersion() {
|
|
641
|
-
if (this.version < 7)
|
|
642
|
-
return;
|
|
643
|
-
let rem = this.version;
|
|
644
|
-
for (let i = 0; i < 12; i++)
|
|
645
|
-
rem = rem << 1 ^ (rem >>> 11) * 7973;
|
|
646
|
-
const bits = this.version << 12 | rem;
|
|
647
|
-
assert(bits >>> 18 == 0);
|
|
648
|
-
for (let i = 0; i < 18; i++) {
|
|
649
|
-
const color = getBit(bits, i);
|
|
650
|
-
const a = this.size - 11 + i % 3;
|
|
651
|
-
const b = Math.floor(i / 3);
|
|
652
|
-
this.setFunctionModule(a, b, color);
|
|
653
|
-
this.setFunctionModule(b, a, color);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
drawFinderPattern(x, y) {
|
|
657
|
-
for (let dy = -4; dy <= 4; dy++) {
|
|
658
|
-
for (let dx = -4; dx <= 4; dx++) {
|
|
659
|
-
const dist = Math.max(Math.abs(dx), Math.abs(dy));
|
|
660
|
-
const xx = x + dx;
|
|
661
|
-
const yy = y + dy;
|
|
662
|
-
if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)
|
|
663
|
-
this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
drawAlignmentPattern(x, y) {
|
|
668
|
-
for (let dy = -2; dy <= 2; dy++) {
|
|
669
|
-
for (let dx = -2; dx <= 2; dx++)
|
|
670
|
-
this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
setFunctionModule(x, y, isDark) {
|
|
674
|
-
this.modules[y][x] = isDark;
|
|
675
|
-
this.isFunction[y][x] = true;
|
|
676
|
-
}
|
|
677
|
-
addEccAndInterleave(data) {
|
|
678
|
-
const ver = this.version;
|
|
679
|
-
const ecl = this.errorCorrectionLevel;
|
|
680
|
-
if (data.length != _QrCode.getNumDataCodewords(ver, ecl))
|
|
681
|
-
throw new RangeError("Invalid argument");
|
|
682
|
-
const numBlocks = _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
|
|
683
|
-
const blockEccLen = _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];
|
|
684
|
-
const rawCodewords = Math.floor(_QrCode.getNumRawDataModules(ver) / 8);
|
|
685
|
-
const numShortBlocks = numBlocks - rawCodewords % numBlocks;
|
|
686
|
-
const shortBlockLen = Math.floor(rawCodewords / numBlocks);
|
|
687
|
-
let blocks = [];
|
|
688
|
-
const rsDiv = _QrCode.reedSolomonComputeDivisor(blockEccLen);
|
|
689
|
-
for (let i = 0, k = 0; i < numBlocks; i++) {
|
|
690
|
-
let dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));
|
|
691
|
-
k += dat.length;
|
|
692
|
-
const ecc = _QrCode.reedSolomonComputeRemainder(dat, rsDiv);
|
|
693
|
-
if (i < numShortBlocks)
|
|
694
|
-
dat.push(0);
|
|
695
|
-
blocks.push(dat.concat(ecc));
|
|
696
|
-
}
|
|
697
|
-
let result = [];
|
|
698
|
-
for (let i = 0; i < blocks[0].length; i++) {
|
|
699
|
-
blocks.forEach((block, j) => {
|
|
700
|
-
if (i != shortBlockLen - blockEccLen || j >= numShortBlocks)
|
|
701
|
-
result.push(block[i]);
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
assert(result.length == rawCodewords);
|
|
705
|
-
return result;
|
|
706
|
-
}
|
|
707
|
-
drawCodewords(data) {
|
|
708
|
-
if (data.length != Math.floor(_QrCode.getNumRawDataModules(this.version) / 8))
|
|
709
|
-
throw new RangeError("Invalid argument");
|
|
710
|
-
let i = 0;
|
|
711
|
-
for (let right = this.size - 1; right >= 1; right -= 2) {
|
|
712
|
-
if (right == 6)
|
|
713
|
-
right = 5;
|
|
714
|
-
for (let vert = 0; vert < this.size; vert++) {
|
|
715
|
-
for (let j = 0; j < 2; j++) {
|
|
716
|
-
const x = right - j;
|
|
717
|
-
const upward = (right + 1 & 2) == 0;
|
|
718
|
-
const y = upward ? this.size - 1 - vert : vert;
|
|
719
|
-
if (!this.isFunction[y][x] && i < data.length * 8) {
|
|
720
|
-
this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));
|
|
721
|
-
i++;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
assert(i == data.length * 8);
|
|
727
|
-
}
|
|
728
|
-
applyMask(mask) {
|
|
729
|
-
if (mask < 0 || mask > 7)
|
|
730
|
-
throw new RangeError("Mask value out of range");
|
|
731
|
-
for (let y = 0; y < this.size; y++) {
|
|
732
|
-
for (let x = 0; x < this.size; x++) {
|
|
733
|
-
let invert;
|
|
734
|
-
switch (mask) {
|
|
735
|
-
case 0:
|
|
736
|
-
invert = (x + y) % 2 == 0;
|
|
737
|
-
break;
|
|
738
|
-
case 1:
|
|
739
|
-
invert = y % 2 == 0;
|
|
740
|
-
break;
|
|
741
|
-
case 2:
|
|
742
|
-
invert = x % 3 == 0;
|
|
743
|
-
break;
|
|
744
|
-
case 3:
|
|
745
|
-
invert = (x + y) % 3 == 0;
|
|
746
|
-
break;
|
|
747
|
-
case 4:
|
|
748
|
-
invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;
|
|
749
|
-
break;
|
|
750
|
-
case 5:
|
|
751
|
-
invert = x * y % 2 + x * y % 3 == 0;
|
|
752
|
-
break;
|
|
753
|
-
case 6:
|
|
754
|
-
invert = (x * y % 2 + x * y % 3) % 2 == 0;
|
|
755
|
-
break;
|
|
756
|
-
case 7:
|
|
757
|
-
invert = ((x + y) % 2 + x * y % 3) % 2 == 0;
|
|
758
|
-
break;
|
|
759
|
-
default:
|
|
760
|
-
throw new Error("Unreachable");
|
|
761
|
-
}
|
|
762
|
-
if (!this.isFunction[y][x] && invert)
|
|
763
|
-
this.modules[y][x] = !this.modules[y][x];
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
getPenaltyScore() {
|
|
768
|
-
let result = 0;
|
|
769
|
-
for (let y = 0; y < this.size; y++) {
|
|
770
|
-
let runColor = false;
|
|
771
|
-
let runX = 0;
|
|
772
|
-
let runHistory = [0, 0, 0, 0, 0, 0, 0];
|
|
773
|
-
for (let x = 0; x < this.size; x++) {
|
|
774
|
-
if (this.modules[y][x] == runColor) {
|
|
775
|
-
runX++;
|
|
776
|
-
if (runX == 5)
|
|
777
|
-
result += _QrCode.PENALTY_N1;
|
|
778
|
-
else if (runX > 5)
|
|
779
|
-
result++;
|
|
780
|
-
} else {
|
|
781
|
-
this.finderPenaltyAddHistory(runX, runHistory);
|
|
782
|
-
if (!runColor)
|
|
783
|
-
result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;
|
|
784
|
-
runColor = this.modules[y][x];
|
|
785
|
-
runX = 1;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode.PENALTY_N3;
|
|
789
|
-
}
|
|
790
|
-
for (let x = 0; x < this.size; x++) {
|
|
791
|
-
let runColor = false;
|
|
792
|
-
let runY = 0;
|
|
793
|
-
let runHistory = [0, 0, 0, 0, 0, 0, 0];
|
|
794
|
-
for (let y = 0; y < this.size; y++) {
|
|
795
|
-
if (this.modules[y][x] == runColor) {
|
|
796
|
-
runY++;
|
|
797
|
-
if (runY == 5)
|
|
798
|
-
result += _QrCode.PENALTY_N1;
|
|
799
|
-
else if (runY > 5)
|
|
800
|
-
result++;
|
|
801
|
-
} else {
|
|
802
|
-
this.finderPenaltyAddHistory(runY, runHistory);
|
|
803
|
-
if (!runColor)
|
|
804
|
-
result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;
|
|
805
|
-
runColor = this.modules[y][x];
|
|
806
|
-
runY = 1;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode.PENALTY_N3;
|
|
810
|
-
}
|
|
811
|
-
for (let y = 0; y < this.size - 1; y++) {
|
|
812
|
-
for (let x = 0; x < this.size - 1; x++) {
|
|
813
|
-
const color = this.modules[y][x];
|
|
814
|
-
if (color == this.modules[y][x + 1] && color == this.modules[y + 1][x] && color == this.modules[y + 1][x + 1])
|
|
815
|
-
result += _QrCode.PENALTY_N2;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
let dark = 0;
|
|
819
|
-
for (const row of this.modules)
|
|
820
|
-
dark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);
|
|
821
|
-
const total = this.size * this.size;
|
|
822
|
-
const k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
|
|
823
|
-
assert(0 <= k && k <= 9);
|
|
824
|
-
result += k * _QrCode.PENALTY_N4;
|
|
825
|
-
assert(0 <= result && result <= 2568888);
|
|
826
|
-
return result;
|
|
827
|
-
}
|
|
828
|
-
getAlignmentPatternPositions() {
|
|
829
|
-
if (this.version == 1)
|
|
830
|
-
return [];
|
|
831
|
-
else {
|
|
832
|
-
const numAlign = Math.floor(this.version / 7) + 2;
|
|
833
|
-
const step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
|
|
834
|
-
let result = [6];
|
|
835
|
-
for (let pos = this.size - 7; result.length < numAlign; pos -= step)
|
|
836
|
-
result.splice(1, 0, pos);
|
|
837
|
-
return result;
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
static getNumRawDataModules(ver) {
|
|
841
|
-
if (ver < _QrCode.MIN_VERSION || ver > _QrCode.MAX_VERSION)
|
|
842
|
-
throw new RangeError("Version number out of range");
|
|
843
|
-
let result = (16 * ver + 128) * ver + 64;
|
|
844
|
-
if (ver >= 2) {
|
|
845
|
-
const numAlign = Math.floor(ver / 7) + 2;
|
|
846
|
-
result -= (25 * numAlign - 10) * numAlign - 55;
|
|
847
|
-
if (ver >= 7)
|
|
848
|
-
result -= 36;
|
|
849
|
-
}
|
|
850
|
-
assert(208 <= result && result <= 29648);
|
|
851
|
-
return result;
|
|
852
|
-
}
|
|
853
|
-
static getNumDataCodewords(ver, ecl) {
|
|
854
|
-
return Math.floor(_QrCode.getNumRawDataModules(ver) / 8) - _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
|
|
855
|
-
}
|
|
856
|
-
static reedSolomonComputeDivisor(degree) {
|
|
857
|
-
if (degree < 1 || degree > 255)
|
|
858
|
-
throw new RangeError("Degree out of range");
|
|
859
|
-
let result = [];
|
|
860
|
-
for (let i = 0; i < degree - 1; i++)
|
|
861
|
-
result.push(0);
|
|
862
|
-
result.push(1);
|
|
863
|
-
let root = 1;
|
|
864
|
-
for (let i = 0; i < degree; i++) {
|
|
865
|
-
for (let j = 0; j < result.length; j++) {
|
|
866
|
-
result[j] = _QrCode.reedSolomonMultiply(result[j], root);
|
|
867
|
-
if (j + 1 < result.length)
|
|
868
|
-
result[j] ^= result[j + 1];
|
|
869
|
-
}
|
|
870
|
-
root = _QrCode.reedSolomonMultiply(root, 2);
|
|
871
|
-
}
|
|
872
|
-
return result;
|
|
873
|
-
}
|
|
874
|
-
static reedSolomonComputeRemainder(data, divisor) {
|
|
875
|
-
let result = divisor.map((_) => 0);
|
|
876
|
-
for (const b of data) {
|
|
877
|
-
const factor = b ^ result.shift();
|
|
878
|
-
result.push(0);
|
|
879
|
-
divisor.forEach((coef, i) => result[i] ^= _QrCode.reedSolomonMultiply(coef, factor));
|
|
880
|
-
}
|
|
881
|
-
return result;
|
|
882
|
-
}
|
|
883
|
-
static reedSolomonMultiply(x, y) {
|
|
884
|
-
if (x >>> 8 != 0 || y >>> 8 != 0)
|
|
885
|
-
throw new RangeError("Byte out of range");
|
|
886
|
-
let z = 0;
|
|
887
|
-
for (let i = 7; i >= 0; i--) {
|
|
888
|
-
z = z << 1 ^ (z >>> 7) * 285;
|
|
889
|
-
z ^= (y >>> i & 1) * x;
|
|
890
|
-
}
|
|
891
|
-
assert(z >>> 8 == 0);
|
|
892
|
-
return z;
|
|
893
|
-
}
|
|
894
|
-
finderPenaltyCountPatterns(runHistory) {
|
|
895
|
-
const n = runHistory[1];
|
|
896
|
-
assert(n <= this.size * 3);
|
|
897
|
-
const core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;
|
|
898
|
-
return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);
|
|
899
|
-
}
|
|
900
|
-
finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {
|
|
901
|
-
if (currentRunColor) {
|
|
902
|
-
this.finderPenaltyAddHistory(currentRunLength, runHistory);
|
|
903
|
-
currentRunLength = 0;
|
|
904
|
-
}
|
|
905
|
-
currentRunLength += this.size;
|
|
906
|
-
this.finderPenaltyAddHistory(currentRunLength, runHistory);
|
|
907
|
-
return this.finderPenaltyCountPatterns(runHistory);
|
|
908
|
-
}
|
|
909
|
-
finderPenaltyAddHistory(currentRunLength, runHistory) {
|
|
910
|
-
if (runHistory[0] == 0)
|
|
911
|
-
currentRunLength += this.size;
|
|
912
|
-
runHistory.pop();
|
|
913
|
-
runHistory.unshift(currentRunLength);
|
|
914
|
-
}
|
|
915
|
-
};
|
|
916
|
-
let QrCode = _QrCode;
|
|
917
|
-
QrCode.MIN_VERSION = 1;
|
|
918
|
-
QrCode.MAX_VERSION = 40;
|
|
919
|
-
QrCode.PENALTY_N1 = 3;
|
|
920
|
-
QrCode.PENALTY_N2 = 3;
|
|
921
|
-
QrCode.PENALTY_N3 = 40;
|
|
922
|
-
QrCode.PENALTY_N4 = 10;
|
|
923
|
-
QrCode.ECC_CODEWORDS_PER_BLOCK = [
|
|
924
|
-
[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
925
|
-
[-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
|
|
926
|
-
[-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
927
|
-
[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
|
|
928
|
-
];
|
|
929
|
-
QrCode.NUM_ERROR_CORRECTION_BLOCKS = [
|
|
930
|
-
[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
|
|
931
|
-
[-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
|
|
932
|
-
[-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
|
|
933
|
-
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
934
|
-
];
|
|
935
|
-
qrcodegen2.QrCode = QrCode;
|
|
936
|
-
function appendBits(val, len, bb) {
|
|
937
|
-
if (len < 0 || len > 31 || val >>> len != 0)
|
|
938
|
-
throw new RangeError("Value out of range");
|
|
939
|
-
for (let i = len - 1; i >= 0; i--)
|
|
940
|
-
bb.push(val >>> i & 1);
|
|
941
|
-
}
|
|
942
|
-
function getBit(x, i) {
|
|
943
|
-
return (x >>> i & 1) != 0;
|
|
944
|
-
}
|
|
945
|
-
function assert(cond) {
|
|
946
|
-
if (!cond)
|
|
947
|
-
throw new Error("Assertion error");
|
|
948
|
-
}
|
|
949
|
-
const _QrSegment = class {
|
|
950
|
-
constructor(mode, numChars, bitData) {
|
|
951
|
-
this.mode = mode;
|
|
952
|
-
this.numChars = numChars;
|
|
953
|
-
this.bitData = bitData;
|
|
954
|
-
if (numChars < 0)
|
|
955
|
-
throw new RangeError("Invalid argument");
|
|
956
|
-
this.bitData = bitData.slice();
|
|
957
|
-
}
|
|
958
|
-
static makeBytes(data) {
|
|
959
|
-
let bb = [];
|
|
960
|
-
for (const b of data)
|
|
961
|
-
appendBits(b, 8, bb);
|
|
962
|
-
return new _QrSegment(_QrSegment.Mode.BYTE, data.length, bb);
|
|
963
|
-
}
|
|
964
|
-
static makeNumeric(digits) {
|
|
965
|
-
if (!_QrSegment.isNumeric(digits))
|
|
966
|
-
throw new RangeError("String contains non-numeric characters");
|
|
967
|
-
let bb = [];
|
|
968
|
-
for (let i = 0; i < digits.length; ) {
|
|
969
|
-
const n = Math.min(digits.length - i, 3);
|
|
970
|
-
appendBits(parseInt(digits.substr(i, n), 10), n * 3 + 1, bb);
|
|
971
|
-
i += n;
|
|
972
|
-
}
|
|
973
|
-
return new _QrSegment(_QrSegment.Mode.NUMERIC, digits.length, bb);
|
|
974
|
-
}
|
|
975
|
-
static makeAlphanumeric(text) {
|
|
976
|
-
if (!_QrSegment.isAlphanumeric(text))
|
|
977
|
-
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
978
|
-
let bb = [];
|
|
979
|
-
let i;
|
|
980
|
-
for (i = 0; i + 2 <= text.length; i += 2) {
|
|
981
|
-
let temp = _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;
|
|
982
|
-
temp += _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));
|
|
983
|
-
appendBits(temp, 11, bb);
|
|
984
|
-
}
|
|
985
|
-
if (i < text.length)
|
|
986
|
-
appendBits(_QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);
|
|
987
|
-
return new _QrSegment(_QrSegment.Mode.ALPHANUMERIC, text.length, bb);
|
|
988
|
-
}
|
|
989
|
-
static makeSegments(text) {
|
|
990
|
-
if (text == "")
|
|
991
|
-
return [];
|
|
992
|
-
else if (_QrSegment.isNumeric(text))
|
|
993
|
-
return [_QrSegment.makeNumeric(text)];
|
|
994
|
-
else if (_QrSegment.isAlphanumeric(text))
|
|
995
|
-
return [_QrSegment.makeAlphanumeric(text)];
|
|
996
|
-
else
|
|
997
|
-
return [_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(text))];
|
|
998
|
-
}
|
|
999
|
-
static makeEci(assignVal) {
|
|
1000
|
-
let bb = [];
|
|
1001
|
-
if (assignVal < 0)
|
|
1002
|
-
throw new RangeError("ECI assignment value out of range");
|
|
1003
|
-
else if (assignVal < 1 << 7)
|
|
1004
|
-
appendBits(assignVal, 8, bb);
|
|
1005
|
-
else if (assignVal < 1 << 14) {
|
|
1006
|
-
appendBits(2, 2, bb);
|
|
1007
|
-
appendBits(assignVal, 14, bb);
|
|
1008
|
-
} else if (assignVal < 1e6) {
|
|
1009
|
-
appendBits(6, 3, bb);
|
|
1010
|
-
appendBits(assignVal, 21, bb);
|
|
1011
|
-
} else
|
|
1012
|
-
throw new RangeError("ECI assignment value out of range");
|
|
1013
|
-
return new _QrSegment(_QrSegment.Mode.ECI, 0, bb);
|
|
1014
|
-
}
|
|
1015
|
-
static isNumeric(text) {
|
|
1016
|
-
return _QrSegment.NUMERIC_REGEX.test(text);
|
|
1017
|
-
}
|
|
1018
|
-
static isAlphanumeric(text) {
|
|
1019
|
-
return _QrSegment.ALPHANUMERIC_REGEX.test(text);
|
|
1020
|
-
}
|
|
1021
|
-
getData() {
|
|
1022
|
-
return this.bitData.slice();
|
|
1023
|
-
}
|
|
1024
|
-
static getTotalBits(segs, version) {
|
|
1025
|
-
let result = 0;
|
|
1026
|
-
for (const seg of segs) {
|
|
1027
|
-
const ccbits = seg.mode.numCharCountBits(version);
|
|
1028
|
-
if (seg.numChars >= 1 << ccbits)
|
|
1029
|
-
return Infinity;
|
|
1030
|
-
result += 4 + ccbits + seg.bitData.length;
|
|
1031
|
-
}
|
|
1032
|
-
return result;
|
|
1033
|
-
}
|
|
1034
|
-
static toUtf8ByteArray(str) {
|
|
1035
|
-
str = encodeURI(str);
|
|
1036
|
-
let result = [];
|
|
1037
|
-
for (let i = 0; i < str.length; i++) {
|
|
1038
|
-
if (str.charAt(i) != "%")
|
|
1039
|
-
result.push(str.charCodeAt(i));
|
|
1040
|
-
else {
|
|
1041
|
-
result.push(parseInt(str.substr(i + 1, 2), 16));
|
|
1042
|
-
i += 2;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
return result;
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
let QrSegment = _QrSegment;
|
|
1049
|
-
QrSegment.NUMERIC_REGEX = /^[0-9]*$/;
|
|
1050
|
-
QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/;
|
|
1051
|
-
QrSegment.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
1052
|
-
qrcodegen2.QrSegment = QrSegment;
|
|
1053
|
-
})(qrcodegen || (qrcodegen = {}));
|
|
1054
|
-
((qrcodegen2) => {
|
|
1055
|
-
((QrCode2) => {
|
|
1056
|
-
const _Ecc = class {
|
|
1057
|
-
constructor(ordinal, formatBits) {
|
|
1058
|
-
this.ordinal = ordinal;
|
|
1059
|
-
this.formatBits = formatBits;
|
|
1060
|
-
}
|
|
1061
|
-
};
|
|
1062
|
-
let Ecc = _Ecc;
|
|
1063
|
-
Ecc.LOW = new _Ecc(0, 1);
|
|
1064
|
-
Ecc.MEDIUM = new _Ecc(1, 0);
|
|
1065
|
-
Ecc.QUARTILE = new _Ecc(2, 3);
|
|
1066
|
-
Ecc.HIGH = new _Ecc(3, 2);
|
|
1067
|
-
QrCode2.Ecc = Ecc;
|
|
1068
|
-
})(qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));
|
|
1069
|
-
})(qrcodegen || (qrcodegen = {}));
|
|
1070
|
-
((qrcodegen2) => {
|
|
1071
|
-
((QrSegment2) => {
|
|
1072
|
-
const _Mode = class {
|
|
1073
|
-
constructor(modeBits, numBitsCharCount) {
|
|
1074
|
-
this.modeBits = modeBits;
|
|
1075
|
-
this.numBitsCharCount = numBitsCharCount;
|
|
1076
|
-
}
|
|
1077
|
-
numCharCountBits(ver) {
|
|
1078
|
-
return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
|
|
1079
|
-
}
|
|
1080
|
-
};
|
|
1081
|
-
let Mode = _Mode;
|
|
1082
|
-
Mode.NUMERIC = new _Mode(1, [10, 12, 14]);
|
|
1083
|
-
Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]);
|
|
1084
|
-
Mode.BYTE = new _Mode(4, [8, 16, 16]);
|
|
1085
|
-
Mode.KANJI = new _Mode(8, [8, 10, 12]);
|
|
1086
|
-
Mode.ECI = new _Mode(7, [0, 0, 0]);
|
|
1087
|
-
QrSegment2.Mode = Mode;
|
|
1088
|
-
})(qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));
|
|
1089
|
-
})(qrcodegen || (qrcodegen = {}));
|
|
1090
|
-
var qrcodegen_default = qrcodegen;
|
|
1091
|
-
|
|
1092
|
-
// src/index.tsx
|
|
1093
|
-
/**
|
|
1094
|
-
* @license qrcode.react
|
|
1095
|
-
* Copyright (c) Paul O'Shannessy
|
|
1096
|
-
* SPDX-License-Identifier: ISC
|
|
1097
|
-
*/
|
|
1098
|
-
var ERROR_LEVEL_MAP = {
|
|
1099
|
-
L: qrcodegen_default.QrCode.Ecc.LOW,
|
|
1100
|
-
M: qrcodegen_default.QrCode.Ecc.MEDIUM,
|
|
1101
|
-
Q: qrcodegen_default.QrCode.Ecc.QUARTILE,
|
|
1102
|
-
H: qrcodegen_default.QrCode.Ecc.HIGH
|
|
1103
|
-
};
|
|
1104
|
-
var DEFAULT_SIZE = 128;
|
|
1105
|
-
var DEFAULT_LEVEL = "L";
|
|
1106
|
-
var DEFAULT_BGCOLOR = "#FFFFFF";
|
|
1107
|
-
var DEFAULT_FGCOLOR = "#000000";
|
|
1108
|
-
var DEFAULT_INCLUDEMARGIN = false;
|
|
1109
|
-
var MARGIN_SIZE = 4;
|
|
1110
|
-
var DEFAULT_IMG_SCALE = 0.1;
|
|
1111
|
-
function generatePath(modules, margin = 0) {
|
|
1112
|
-
const ops = [];
|
|
1113
|
-
modules.forEach(function(row, y) {
|
|
1114
|
-
let start = null;
|
|
1115
|
-
row.forEach(function(cell, x) {
|
|
1116
|
-
if (!cell && start !== null) {
|
|
1117
|
-
ops.push(`M${start + margin} ${y + margin}h${x - start}v1H${start + margin}z`);
|
|
1118
|
-
start = null;
|
|
1119
|
-
return;
|
|
1120
|
-
}
|
|
1121
|
-
if (x === row.length - 1) {
|
|
1122
|
-
if (!cell) {
|
|
1123
|
-
return;
|
|
1124
|
-
}
|
|
1125
|
-
if (start === null) {
|
|
1126
|
-
ops.push(`M${x + margin},${y + margin} h1v1H${x + margin}z`);
|
|
1127
|
-
} else {
|
|
1128
|
-
ops.push(`M${start + margin},${y + margin} h${x + 1 - start}v1H${start + margin}z`);
|
|
1129
|
-
}
|
|
1130
|
-
return;
|
|
1131
|
-
}
|
|
1132
|
-
if (cell && start === null) {
|
|
1133
|
-
start = x;
|
|
1134
|
-
}
|
|
1135
|
-
});
|
|
1136
|
-
});
|
|
1137
|
-
return ops.join("");
|
|
1138
|
-
}
|
|
1139
|
-
function excavateModules(modules, excavation) {
|
|
1140
|
-
return modules.slice().map((row, y) => {
|
|
1141
|
-
if (y < excavation.y || y >= excavation.y + excavation.h) {
|
|
1142
|
-
return row;
|
|
1143
|
-
}
|
|
1144
|
-
return row.map((cell, x) => {
|
|
1145
|
-
if (x < excavation.x || x >= excavation.x + excavation.w) {
|
|
1146
|
-
return cell;
|
|
1147
|
-
}
|
|
1148
|
-
return false;
|
|
1149
|
-
});
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
function getImageSettings(cells, size, includeMargin, imageSettings) {
|
|
1153
|
-
if (imageSettings == null) {
|
|
1154
|
-
return null;
|
|
1155
|
-
}
|
|
1156
|
-
const margin = includeMargin ? MARGIN_SIZE : 0;
|
|
1157
|
-
const numCells = cells.length + margin * 2;
|
|
1158
|
-
const defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);
|
|
1159
|
-
const scale = numCells / size;
|
|
1160
|
-
const w = (imageSettings.width || defaultSize) * scale;
|
|
1161
|
-
const h = (imageSettings.height || defaultSize) * scale;
|
|
1162
|
-
const x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;
|
|
1163
|
-
const y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;
|
|
1164
|
-
let excavation = null;
|
|
1165
|
-
if (imageSettings.excavate) {
|
|
1166
|
-
let floorX = Math.floor(x);
|
|
1167
|
-
let floorY = Math.floor(y);
|
|
1168
|
-
let ceilW = Math.ceil(w + x - floorX);
|
|
1169
|
-
let ceilH = Math.ceil(h + y - floorY);
|
|
1170
|
-
excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH };
|
|
1171
|
-
}
|
|
1172
|
-
return { x, y, h, w, excavation };
|
|
1173
|
-
}
|
|
1174
|
-
var SUPPORTS_PATH2D = function() {
|
|
1175
|
-
try {
|
|
1176
|
-
new Path2D().addPath(new Path2D());
|
|
1177
|
-
} catch (e) {
|
|
1178
|
-
return false;
|
|
1179
|
-
}
|
|
1180
|
-
return true;
|
|
1181
|
-
}();
|
|
1182
|
-
function QRCodeCanvas(props) {
|
|
1183
|
-
const _a = props, {
|
|
1184
|
-
value,
|
|
1185
|
-
size = DEFAULT_SIZE,
|
|
1186
|
-
level = DEFAULT_LEVEL,
|
|
1187
|
-
bgColor = DEFAULT_BGCOLOR,
|
|
1188
|
-
fgColor = DEFAULT_FGCOLOR,
|
|
1189
|
-
includeMargin = DEFAULT_INCLUDEMARGIN,
|
|
1190
|
-
style,
|
|
1191
|
-
imageSettings
|
|
1192
|
-
} = _a, otherProps = __objRest(_a, [
|
|
1193
|
-
"value",
|
|
1194
|
-
"size",
|
|
1195
|
-
"level",
|
|
1196
|
-
"bgColor",
|
|
1197
|
-
"fgColor",
|
|
1198
|
-
"includeMargin",
|
|
1199
|
-
"style",
|
|
1200
|
-
"imageSettings"
|
|
1201
|
-
]);
|
|
1202
|
-
const imgSrc = imageSettings == null ? void 0 : imageSettings.src;
|
|
1203
|
-
const _canvas = useRef(null);
|
|
1204
|
-
const _image = useRef(null);
|
|
1205
|
-
const [isImgLoaded, setIsImageLoaded] = useState(false);
|
|
1206
|
-
useEffect(() => {
|
|
1207
|
-
if (_canvas.current != null) {
|
|
1208
|
-
const canvas = _canvas.current;
|
|
1209
|
-
const ctx = canvas.getContext("2d");
|
|
1210
|
-
if (!ctx) {
|
|
1211
|
-
return;
|
|
1212
|
-
}
|
|
1213
|
-
let cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();
|
|
1214
|
-
const margin = includeMargin ? MARGIN_SIZE : 0;
|
|
1215
|
-
const numCells = cells.length + margin * 2;
|
|
1216
|
-
const calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);
|
|
1217
|
-
const image = _image.current;
|
|
1218
|
-
const haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;
|
|
1219
|
-
if (haveImageToRender) {
|
|
1220
|
-
if (calculatedImageSettings.excavation != null) {
|
|
1221
|
-
cells = excavateModules(cells, calculatedImageSettings.excavation);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
const pixelRatio = window.devicePixelRatio || 1;
|
|
1225
|
-
canvas.height = canvas.width = size * pixelRatio;
|
|
1226
|
-
const scale = size / numCells * pixelRatio;
|
|
1227
|
-
ctx.scale(scale, scale);
|
|
1228
|
-
ctx.fillStyle = bgColor;
|
|
1229
|
-
ctx.fillRect(0, 0, numCells, numCells);
|
|
1230
|
-
ctx.fillStyle = fgColor;
|
|
1231
|
-
if (SUPPORTS_PATH2D) {
|
|
1232
|
-
ctx.fill(new Path2D(generatePath(cells, margin)));
|
|
1233
|
-
} else {
|
|
1234
|
-
cells.forEach(function(row, rdx) {
|
|
1235
|
-
row.forEach(function(cell, cdx) {
|
|
1236
|
-
if (cell) {
|
|
1237
|
-
ctx.fillRect(cdx + margin, rdx + margin, 1, 1);
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
if (haveImageToRender) {
|
|
1243
|
-
ctx.drawImage(image, calculatedImageSettings.x + margin, calculatedImageSettings.y + margin, calculatedImageSettings.w, calculatedImageSettings.h);
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
});
|
|
1247
|
-
useEffect(() => {
|
|
1248
|
-
setIsImageLoaded(false);
|
|
1249
|
-
}, [imgSrc]);
|
|
1250
|
-
const canvasStyle = __spreadValues({ height: size, width: size }, style);
|
|
1251
|
-
let img = null;
|
|
1252
|
-
if (imgSrc != null) {
|
|
1253
|
-
img = /* @__PURE__ */ React__default.createElement("img", {
|
|
1254
|
-
src: imgSrc,
|
|
1255
|
-
key: imgSrc,
|
|
1256
|
-
style: { display: "none" },
|
|
1257
|
-
onLoad: () => {
|
|
1258
|
-
setIsImageLoaded(true);
|
|
1259
|
-
},
|
|
1260
|
-
ref: _image
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("canvas", __spreadValues({
|
|
1264
|
-
style: canvasStyle,
|
|
1265
|
-
height: size,
|
|
1266
|
-
width: size,
|
|
1267
|
-
ref: _canvas
|
|
1268
|
-
}, otherProps)), img);
|
|
1269
|
-
}
|
|
1270
|
-
function QRCodeSVG(props) {
|
|
1271
|
-
const _a = props, {
|
|
1272
|
-
value,
|
|
1273
|
-
size = DEFAULT_SIZE,
|
|
1274
|
-
level = DEFAULT_LEVEL,
|
|
1275
|
-
bgColor = DEFAULT_BGCOLOR,
|
|
1276
|
-
fgColor = DEFAULT_FGCOLOR,
|
|
1277
|
-
includeMargin = DEFAULT_INCLUDEMARGIN,
|
|
1278
|
-
imageSettings
|
|
1279
|
-
} = _a, otherProps = __objRest(_a, [
|
|
1280
|
-
"value",
|
|
1281
|
-
"size",
|
|
1282
|
-
"level",
|
|
1283
|
-
"bgColor",
|
|
1284
|
-
"fgColor",
|
|
1285
|
-
"includeMargin",
|
|
1286
|
-
"imageSettings"
|
|
1287
|
-
]);
|
|
1288
|
-
let cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();
|
|
1289
|
-
const margin = includeMargin ? MARGIN_SIZE : 0;
|
|
1290
|
-
const numCells = cells.length + margin * 2;
|
|
1291
|
-
const calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);
|
|
1292
|
-
let image = null;
|
|
1293
|
-
if (imageSettings != null && calculatedImageSettings != null) {
|
|
1294
|
-
if (calculatedImageSettings.excavation != null) {
|
|
1295
|
-
cells = excavateModules(cells, calculatedImageSettings.excavation);
|
|
1296
|
-
}
|
|
1297
|
-
image = /* @__PURE__ */ React__default.createElement("image", {
|
|
1298
|
-
xlinkHref: imageSettings.src,
|
|
1299
|
-
height: calculatedImageSettings.h,
|
|
1300
|
-
width: calculatedImageSettings.w,
|
|
1301
|
-
x: calculatedImageSettings.x + margin,
|
|
1302
|
-
y: calculatedImageSettings.y + margin,
|
|
1303
|
-
preserveAspectRatio: "none"
|
|
1304
|
-
});
|
|
1305
|
-
}
|
|
1306
|
-
const fgPath = generatePath(cells, margin);
|
|
1307
|
-
return /* @__PURE__ */ React__default.createElement("svg", __spreadValues({
|
|
1308
|
-
height: size,
|
|
1309
|
-
width: size,
|
|
1310
|
-
viewBox: `0 0 ${numCells} ${numCells}`
|
|
1311
|
-
}, otherProps), /* @__PURE__ */ React__default.createElement("path", {
|
|
1312
|
-
fill: bgColor,
|
|
1313
|
-
d: `M0,0 h${numCells}v${numCells}H0z`,
|
|
1314
|
-
shapeRendering: "crispEdges"
|
|
1315
|
-
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
1316
|
-
fill: fgColor,
|
|
1317
|
-
d: fgPath,
|
|
1318
|
-
shapeRendering: "crispEdges"
|
|
1319
|
-
}), image);
|
|
1320
|
-
}
|
|
1321
|
-
var QRCode$1 = (props) => {
|
|
1322
|
-
const _a = props, { renderAs } = _a, otherProps = __objRest(_a, ["renderAs"]);
|
|
1323
|
-
if (renderAs === "svg") {
|
|
1324
|
-
return /* @__PURE__ */ React__default.createElement(QRCodeSVG, __spreadValues({}, otherProps));
|
|
1325
|
-
}
|
|
1326
|
-
return /* @__PURE__ */ React__default.createElement(QRCodeCanvas, __spreadValues({}, otherProps));
|
|
1327
|
-
};
|
|
1328
|
-
|
|
1329
|
-
var QRCode = function QRCode(_ref) {
|
|
1330
|
-
var entity = _ref.entity,
|
|
1331
|
-
url = _ref.url;
|
|
1332
|
-
if (!entity) return null;
|
|
1333
|
-
var id = entity.id,
|
|
1334
|
-
name = entity.name;
|
|
1335
|
-
var canvasId = "qrcode-share-".concat(id);
|
|
1336
|
-
var handleDownload = function handleDownload() {
|
|
1337
|
-
var canvas = document.getElementById(canvasId);
|
|
1338
|
-
if (canvas) downloadCanvas(canvas, {
|
|
1339
|
-
name: slugify(name)
|
|
1340
|
-
});
|
|
1341
|
-
};
|
|
1342
|
-
return /*#__PURE__*/jsxs("div", {
|
|
1343
|
-
className: "neeto-ui-border-gray-200 flex flex-col justify-start space-y-2 border-t py-3 pl-8 sm:space-y-4 sm:border-l sm:py-2 sm:pl-6",
|
|
1344
|
-
"data-cy": "qr-download-block",
|
|
1345
|
-
"data-testid": "qr-download-block",
|
|
1346
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
1347
|
-
lineHeight: "normal",
|
|
1348
|
-
style: "body2",
|
|
1349
|
-
weight: "medium",
|
|
1350
|
-
children: /*#__PURE__*/jsx(Trans, {
|
|
1351
|
-
i18nKey: "neetoMolecules.shareViaLink.socialMediaShare.qrCodeInfo",
|
|
1352
|
-
components: {
|
|
1353
|
-
button: /*#__PURE__*/jsx(Button, {
|
|
1354
|
-
"data-cy": "qr-code-download-button",
|
|
1355
|
-
"data-testid": "qr-code-download-button",
|
|
1356
|
-
style: "link",
|
|
1357
|
-
onClick: handleDownload
|
|
1358
|
-
})
|
|
1359
|
-
}
|
|
1360
|
-
})
|
|
1361
|
-
}), /*#__PURE__*/jsx(QRCode$1, {
|
|
1362
|
-
className: "cursor-pointer",
|
|
1363
|
-
"data-cy": "qr-code-image",
|
|
1364
|
-
"data-testid": canvasId,
|
|
1365
|
-
id: canvasId,
|
|
1366
|
-
size: 256,
|
|
1367
|
-
style: {
|
|
1368
|
-
width: 80,
|
|
1369
|
-
height: 80
|
|
1370
|
-
},
|
|
1371
|
-
value: url,
|
|
1372
|
-
onClick: handleDownload
|
|
1373
|
-
})]
|
|
1374
|
-
});
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
var Subtitle = function Subtitle(_ref) {
|
|
1378
|
-
var link = _ref.link,
|
|
1379
|
-
dataCy = _ref.dataCy,
|
|
1380
|
-
_onClick = _ref.onClick,
|
|
1381
|
-
subtitle = _ref.subtitle;
|
|
1382
|
-
var Component = isPresent(link) ? Link$1 : "div";
|
|
1383
|
-
return /*#__PURE__*/jsx(Component, {
|
|
1384
|
-
"data-cy": dataCy,
|
|
1385
|
-
to: link,
|
|
1386
|
-
onClick: function onClick(event) {
|
|
1387
|
-
event.preventDefault();
|
|
1388
|
-
_onClick === null || _onClick === void 0 || _onClick(event);
|
|
1389
|
-
},
|
|
1390
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
1391
|
-
style: "body3",
|
|
1392
|
-
weight: "medium",
|
|
1393
|
-
className: classnames("break-words", {
|
|
1394
|
-
"neeto-ui-text-accent-800": isPresent(_onClick) || isPresent(link)
|
|
1395
|
-
}),
|
|
1396
|
-
children: subtitle
|
|
1397
|
-
})
|
|
1398
|
-
});
|
|
1399
|
-
};
|
|
1400
|
-
|
|
1401
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1402
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1403
|
-
var ShareBlock = function ShareBlock(_ref) {
|
|
1404
|
-
var entity = _ref.entity,
|
|
1405
|
-
postTitle = _ref.postTitle,
|
|
1406
|
-
url = _ref.url,
|
|
1407
|
-
moreOptions = _ref.moreOptions,
|
|
1408
|
-
disableShareSocialMedia = _ref.disableShareSocialMedia,
|
|
1409
|
-
disableQRDownload = _ref.disableQRDownload;
|
|
1410
|
-
var _useTranslation = useTranslation(),
|
|
1411
|
-
t = _useTranslation.t;
|
|
1412
|
-
var socialMediaButtonClasses = "neeto-ui-bg-gray-200 hover:neeto-ui-bg-gray-300 flex h-10 w-10 cursor-pointer items-center justify-center neeto-ui-rounded-md transition-colors duration-300 ease-in-out";
|
|
1413
|
-
var hasMoreOptions = isPresent(moreOptions);
|
|
1414
|
-
return /*#__PURE__*/jsxs("div", {
|
|
1415
|
-
className: "flex flex-col divide-y sm:flex-row sm:gap-6 sm:divide-x sm:divide-y-0",
|
|
1416
|
-
children: [hasMoreOptions && /*#__PURE__*/jsx("div", {
|
|
1417
|
-
className: "max-w-md divide-y",
|
|
1418
|
-
children: moreOptions.map(function (_ref2, index) {
|
|
1419
|
-
var title = _ref2.title,
|
|
1420
|
-
link = _ref2.link,
|
|
1421
|
-
Icon = _ref2.icon,
|
|
1422
|
-
onClick = _ref2.onClick,
|
|
1423
|
-
dataCy = _ref2.dataCy,
|
|
1424
|
-
subtitleProps = _ref2.subtitleProps;
|
|
1425
|
-
var Component = isPresent(link) ? Link$1 : "div";
|
|
1426
|
-
return /*#__PURE__*/createElement(Component, {
|
|
1427
|
-
onClick: onClick,
|
|
1428
|
-
"data-cy": dataCy,
|
|
1429
|
-
key: link,
|
|
1430
|
-
to: link,
|
|
1431
|
-
className: classnames("neeto-ui-border-gray-200 flex cursor-pointer items-center gap-x-2 border-t py-3", {
|
|
1432
|
-
"border-none": index === 0
|
|
1433
|
-
})
|
|
1434
|
-
}, /*#__PURE__*/jsxs("div", {
|
|
1435
|
-
className: "flex flex-row gap-2",
|
|
1436
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
1437
|
-
className: "neeto-ui-text-gray-500 flex-shrink-0",
|
|
1438
|
-
size: 24
|
|
1439
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
1440
|
-
className: "flex flex-col gap-1",
|
|
1441
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
1442
|
-
className: "group-hover:underline",
|
|
1443
|
-
style: "body2",
|
|
1444
|
-
weight: "medium",
|
|
1445
|
-
children: title
|
|
1446
|
-
}), subtitleProps && /*#__PURE__*/jsx(Subtitle, _objectSpread({}, subtitleProps))]
|
|
1447
|
-
})]
|
|
1448
|
-
}));
|
|
1449
|
-
})
|
|
1450
|
-
}), !disableShareSocialMedia && /*#__PURE__*/jsxs("div", {
|
|
1451
|
-
"data-cy": "social-media-block",
|
|
1452
|
-
"data-testid": "social-media-block",
|
|
1453
|
-
className: classnames("neeto-ui-border-gray-200 space-y-2 border-t py-3 sm:space-y-4 sm:border-l sm:py-2", {
|
|
1454
|
-
"pl-8 sm:pl-6": hasMoreOptions
|
|
1455
|
-
}),
|
|
1456
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
1457
|
-
className: "neeto-ui-text-gray-800",
|
|
1458
|
-
lineHeight: "normal",
|
|
1459
|
-
style: "body2",
|
|
1460
|
-
weight: "medium",
|
|
1461
|
-
children: t("neetoMolecules.shareViaLink.socialMediaShare.title")
|
|
1462
|
-
}), /*#__PURE__*/jsx("div", {
|
|
1463
|
-
className: "flex gap-4",
|
|
1464
|
-
children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref3) {
|
|
1465
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
1466
|
-
key = _ref4[0],
|
|
1467
|
-
_ref4$ = _ref4[1],
|
|
1468
|
-
label = _ref4$.label,
|
|
1469
|
-
Icon = _ref4$.icon,
|
|
1470
|
-
generateShareUrl = _ref4$.generateShareUrl;
|
|
1471
|
-
return /*#__PURE__*/jsx("a", {
|
|
1472
|
-
className: socialMediaButtonClasses,
|
|
1473
|
-
"data-cy": "social-media-button-".concat(key),
|
|
1474
|
-
"data-testid": "social-media-button-".concat(key),
|
|
1475
|
-
href: generateShareUrl({
|
|
1476
|
-
url: url,
|
|
1477
|
-
title: postTitle
|
|
1478
|
-
}),
|
|
1479
|
-
rel: "noopener noreferrer",
|
|
1480
|
-
target: "_blank",
|
|
1481
|
-
title: label,
|
|
1482
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
1483
|
-
size: 24
|
|
1484
|
-
})
|
|
1485
|
-
}, key);
|
|
1486
|
-
})
|
|
1487
|
-
})]
|
|
1488
|
-
}), !disableQRDownload && /*#__PURE__*/jsx(QRCode, {
|
|
1489
|
-
entity: entity,
|
|
1490
|
-
url: url
|
|
1491
|
-
})]
|
|
1492
|
-
});
|
|
1493
|
-
};
|
|
1494
|
-
|
|
1495
|
-
var ShareViaLink = function ShareViaLink(_ref) {
|
|
1496
|
-
var _ref$isLoading = _ref.isLoading,
|
|
1497
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
1498
|
-
_ref$enabledOptions = _ref.enabledOptions,
|
|
1499
|
-
enabledOptions = _ref$enabledOptions === void 0 ? {
|
|
1500
|
-
regenerate: false,
|
|
1501
|
-
edit: false
|
|
1502
|
-
} : _ref$enabledOptions,
|
|
1503
|
-
_ref$urls = _ref.urls,
|
|
1504
|
-
urls = _ref$urls === void 0 ? [] : _ref$urls,
|
|
1505
|
-
entity = _ref.entity,
|
|
1506
|
-
entityName = _ref.entityName,
|
|
1507
|
-
_ref$handleEdit = _ref.handleEdit,
|
|
1508
|
-
handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
|
|
1509
|
-
_ref$handleRegenerate = _ref.handleRegenerate,
|
|
1510
|
-
handleRegenerate = _ref$handleRegenerate === void 0 ? noop : _ref$handleRegenerate,
|
|
1511
|
-
socialMediaPostTitle = _ref.socialMediaPostTitle,
|
|
1512
|
-
moreOptions = _ref.moreOptions,
|
|
1513
|
-
_ref$isOtherShareOpti = _ref.isOtherShareOptionsEnabled,
|
|
1514
|
-
isOtherShareOptionsEnabled = _ref$isOtherShareOpti === void 0 ? true : _ref$isOtherShareOpti,
|
|
1515
|
-
_ref$disableShareSoci = _ref.disableShareSocialMedia,
|
|
1516
|
-
disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
|
|
1517
|
-
_ref$disableQRDownloa = _ref.disableQRDownload,
|
|
1518
|
-
disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
|
|
1519
|
-
_ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
|
|
1520
|
-
publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
|
|
1521
|
-
return /*#__PURE__*/jsxs("div", {
|
|
1522
|
-
className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white col-span-2 space-y-4 border p-6 sm:p-8",
|
|
1523
|
-
"data-testid": "share-via-link",
|
|
1524
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
1525
|
-
className: "space-y-1",
|
|
1526
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
1527
|
-
className: "space-y-4",
|
|
1528
|
-
children: urls.map(function (urlOption) {
|
|
1529
|
-
return /*#__PURE__*/createElement(Link, {
|
|
1530
|
-
enabledOptions: enabledOptions,
|
|
1531
|
-
entityName: entityName,
|
|
1532
|
-
handleEdit: handleEdit,
|
|
1533
|
-
handleRegenerate: handleRegenerate,
|
|
1534
|
-
isLoading: isLoading,
|
|
1535
|
-
editUrlProps: omit(["url"], urlOption),
|
|
1536
|
-
key: urlOption.url,
|
|
1537
|
-
previewUrl: urlOption.previewUrl,
|
|
1538
|
-
url: urlOption.url
|
|
1539
|
-
});
|
|
1540
|
-
})
|
|
1541
|
-
}), isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsx(ExpiryNotice, {
|
|
1542
|
-
expiryConfiguration: publicLinkExpiryConfiguration
|
|
1543
|
-
})]
|
|
1544
|
-
}), isOtherShareOptionsEnabled && /*#__PURE__*/jsx(ShareBlock, {
|
|
1545
|
-
disableQRDownload: disableQRDownload,
|
|
1546
|
-
disableShareSocialMedia: disableShareSocialMedia,
|
|
1547
|
-
entity: entity,
|
|
1548
|
-
moreOptions: moreOptions,
|
|
1549
|
-
postTitle: socialMediaPostTitle,
|
|
1550
|
-
url: urls[0].url
|
|
1551
|
-
})]
|
|
1552
|
-
});
|
|
1553
|
-
};
|
|
1554
|
-
|
|
1555
|
-
export { ShareViaLink as default };
|
|
1556
|
-
//# sourceMappingURL=ShareViaLink.js.map
|