diff --git a/packages/desktop/App.svelte b/packages/desktop/App.svelte index a6d577b66c..4dc58481cb 100644 --- a/packages/desktop/App.svelte +++ b/packages/desktop/App.svelte @@ -2,7 +2,7 @@ import { handleDeepLink } from '@auxiliary/deep-link/handlers/handleDeepLink' import { Popup, ProfileAuthPopup } from '@components/popup' import TitleBar from '@components/TitleBar.svelte' - import { IS_WINDOWS, Platform } from '@core/app' + import { IS_WINDOWS, Platform, openUrlInBrowser } from '@core/app' import { registerAppEvents, getAndUpdateDarkMode } from '@core/app/actions' import { appSettings, appVersionDetails, initAppSettings, setAppVersionDetails } from '@core/app/stores' import { isLocaleLoaded, localeDirection, setupI18n } from '@core/i18n' @@ -60,6 +60,7 @@ await checkAndMigrateProfiles() await cleanupEmptyProfiles() Platform.onEvent('deep-link-request', handleDeepLink) + Platform.onEvent('try-open-url-in-browser', openUrlInBrowser) setTimeout(() => { splash = false diff --git a/packages/desktop/lib/electron/processes/main.process.ts b/packages/desktop/lib/electron/processes/main.process.ts index 61b96e9904..7dfcfaea8c 100644 --- a/packages/desktop/lib/electron/processes/main.process.ts +++ b/packages/desktop/lib/electron/processes/main.process.ts @@ -265,6 +265,15 @@ export function createMainWindow(): BrowserWindow { cb('') }) + windows.main.webContents.setWindowOpenHandler((details) => { + try { + windows.main.webContents.send('try-open-url-in-browser', details.url) + } catch (err) { + console.error(err) + } + return { action: 'deny' } + }) + /** * Handle permissions requests */ diff --git a/packages/desktop/views/dashboard/governance/views/ProposalDetailsView.svelte b/packages/desktop/views/dashboard/governance/views/ProposalDetailsView.svelte index 6d6381a831..9c7eed6884 100644 --- a/packages/desktop/views/dashboard/governance/views/ProposalDetailsView.svelte +++ b/packages/desktop/views/dashboard/governance/views/ProposalDetailsView.svelte @@ -5,7 +5,7 @@ VotingEventPayload, TrackedParticipationOverview, } from '@iota/sdk/out/types' - import { Alert, Button, Table } from '@bloomwalletio/ui' + import { Alert, Button, MarkdownBlock, Table } from '@bloomwalletio/ui' import { ProposalDetailsMenu } from '@components' import { getVotingEvent } from '@contexts/governance/actions' import { @@ -36,7 +36,7 @@ import { getBestTimeDuration, milestoneToDate } from '@core/utils' import { PopupId, openPopup } from '@desktop/auxiliary/popup' import { ProposalInformationPane, ProposalQuestion, ProposalStatusPill } from '@views/governance' - import { MarkdownBlock, Pane, Text, TextType } from '@ui' + import { Pane, Text, TextType } from '@ui' import { onDestroy, onMount } from 'svelte' const { metadata } = $visibleSelectedAccountTokens?.[$activeProfile?.network?.id]?.baseCoin ?? {} diff --git a/packages/shared/package.json b/packages/shared/package.json index c7dafe2ba5..5c275dc3cc 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -5,7 +5,7 @@ "author": "Bloom Labs Ltd ", "license": "Apache-2.0", "dependencies": { - "@bloomwalletio/ui": "0.20.4", + "@bloomwalletio/ui": "0.20.6", "@ethereumjs/rlp": "4.0.1", "@ethereumjs/tx": "5.2.1", "@ethereumjs/util": "9.0.2", @@ -25,7 +25,6 @@ "sha3": "2.1.4", "svelte": "3.58.0", "svelte-i18n": "3.7.4", - "svelte-markdown": "0.4.1", "web3": "1.10.0", "zxcvbn": "4.4.2" }, diff --git a/packages/shared/src/components/molecules/MarkdownBlock.svelte b/packages/shared/src/components/molecules/MarkdownBlock.svelte deleted file mode 100644 index 7959dba48a..0000000000 --- a/packages/shared/src/components/molecules/MarkdownBlock.svelte +++ /dev/null @@ -1,42 +0,0 @@ - - -
- -
- - diff --git a/packages/shared/src/components/molecules/index.ts b/packages/shared/src/components/molecules/index.ts index fd0bc3e344..9ece54edf5 100644 --- a/packages/shared/src/components/molecules/index.ts +++ b/packages/shared/src/components/molecules/index.ts @@ -2,7 +2,6 @@ export { default as ActivityInformation } from './ActivityInformation.svelte' export { default as DappInfo } from './DappInfo.svelte' export { default as DappVerificationIcon } from './DappVerificationIcon.svelte' export { default as LedgerStatusIllustration } from './LedgerStatusIllustration.svelte' -export { default as MarkdownBlock } from './MarkdownBlock.svelte' export { default as MediaIcon } from './MediaIcon.svelte' export { default as MediaPlaceholder } from './MediaPlaceholder.svelte' export { default as NetworkRecipientItem } from './NetworkRecipientItem.svelte' diff --git a/packages/shared/src/components/molecules/markdown-renderers/LinkBlock.svelte b/packages/shared/src/components/molecules/markdown-renderers/LinkBlock.svelte deleted file mode 100644 index fda1654be2..0000000000 --- a/packages/shared/src/components/molecules/markdown-renderers/LinkBlock.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/packages/shared/src/components/molecules/markdown-renderers/ParagraphBlock.svelte b/packages/shared/src/components/molecules/markdown-renderers/ParagraphBlock.svelte deleted file mode 100644 index e72a657bba..0000000000 --- a/packages/shared/src/components/molecules/markdown-renderers/ParagraphBlock.svelte +++ /dev/null @@ -1 +0,0 @@ -

diff --git a/packages/shared/src/lib/core/app/interfaces/platform-event-map.interface.ts b/packages/shared/src/lib/core/app/interfaces/platform-event-map.interface.ts index 37e7b5ea4c..c079f31f8d 100644 --- a/packages/shared/src/lib/core/app/interfaces/platform-event-map.interface.ts +++ b/packages/shared/src/lib/core/app/interfaces/platform-event-map.interface.ts @@ -27,4 +27,5 @@ export interface IPlatformEventMap { 'version-details': IAppVersionDetails 'version-error': Error 'version-progress': IAppUpdateDownloadProgress + 'try-open-url-in-browser': string } diff --git a/yarn.lock b/yarn.lock index d9f363afb6..78e86cfe65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,10 +343,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bloomwalletio/ui@0.20.4": - version "0.20.4" - resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.20.4/55e00320965048d0daef162c9288ac5c75a9da6d#55e00320965048d0daef162c9288ac5c75a9da6d" - integrity sha512-LIwFYpkUrvVJbJMNYucjOFej7+IOYiKswkUNdS1qMFOzAch2zGCr/hDvh31eukhdzEVCCfP5bGLLI2Ck9awKfA== +"@bloomwalletio/ui@0.20.6": + version "0.20.6" + resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.20.6/566636d21ecf9553142868a95d7bf2c64e2a3007#566636d21ecf9553142868a95d7bf2c64e2a3007" + integrity sha512-MqU+umZ5IaODS0/Zi4zJdzbeVta2wbBmBz9hbSK7JEKCqFiZ9ocgmZXw5IZmb5nbWLUQUzdVUT8/C6m4pY+pCg== dependencies: "@floating-ui/dom" "1.4.3" "@popperjs/core" "2.11.8"