From 1618997911ef9f3d934958e7dd087c74e5f5a093 Mon Sep 17 00:00:00 2001 From: Jean Ribeiro Date: Wed, 21 Feb 2024 09:39:08 -0300 Subject: [PATCH 1/5] refactor: rebrand MarkdownBlock --- .../views/ProposalDetailsView.svelte | 4 +- packages/shared/package.json | 3 +- .../components/molecules/MarkdownBlock.svelte | 42 ------------------- .../shared/src/components/molecules/index.ts | 1 - .../markdown-renderers/LinkBlock.svelte | 12 ------ .../markdown-renderers/ParagraphBlock.svelte | 1 - yarn.lock | 9 ++-- 7 files changed, 8 insertions(+), 64 deletions(-) delete mode 100644 packages/shared/src/components/molecules/MarkdownBlock.svelte delete mode 100644 packages/shared/src/components/molecules/markdown-renderers/LinkBlock.svelte delete mode 100644 packages/shared/src/components/molecules/markdown-renderers/ParagraphBlock.svelte 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 03f42bfa0b..900f1db465 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.3", + "@bloomwalletio/ui": "0.20.4", "@ethereumjs/rlp": "4.0.1", "@ethereumjs/tx": "5.2.1", "@ethereumjs/util": "9.0.2", @@ -30,7 +30,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 8693583434..fed7abb3ff 100644 --- a/packages/shared/src/components/molecules/index.ts +++ b/packages/shared/src/components/molecules/index.ts @@ -1,6 +1,5 @@ export { default as ActivityInformation } from './ActivityInformation.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/yarn.lock b/yarn.lock index 5a8a3f8791..dd777bf9d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,15 +343,16 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bloomwalletio/ui@0.20.3": - version "0.20.3" - resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.20.3/4ff384a8f0e32eb1d7ac72ecccdeabd5670030f8#4ff384a8f0e32eb1d7ac72ecccdeabd5670030f8" - integrity sha512-QEHsdq9isrs+m6osZRdafRFgac5k4Zcxn5AtQAwFjG0za/R6nAlP3zrs6GQpjGwglpIBMjNMMrXtt+8p+StKPQ== +"@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== dependencies: "@floating-ui/dom" "1.4.3" "@popperjs/core" "2.11.8" qrious "4.0.2" svelte-json-tree "2.1.0" + svelte-markdown "0.4.1" svelty-picker "4.1.4" tailwind-merge "1.13.2" From 3a40cf90e2e359db10577cef0ba1329df53f27af Mon Sep 17 00:00:00 2001 From: Tuditi Date: Wed, 21 Feb 2024 15:57:54 +0100 Subject: [PATCH 2/5] feat: override window open handler of main window --- packages/desktop/lib/electron/processes/main.process.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/desktop/lib/electron/processes/main.process.ts b/packages/desktop/lib/electron/processes/main.process.ts index 61b96e9904..a99d6f2669 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 { + void shell.openExternal(details.url) + } catch (err) { + console.error(err) + } + return { action: 'deny' } + }) + /** * Handle permissions requests */ From b1681f457a960ecd942c19b5c8110a57583db7c3 Mon Sep 17 00:00:00 2001 From: Jean Ribeiro Date: Wed, 21 Feb 2024 14:01:11 -0300 Subject: [PATCH 3/5] fix: link handling --- packages/desktop/App.svelte | 3 ++- packages/desktop/lib/electron/processes/main.process.ts | 2 +- .../lib/core/app/interfaces/platform-event-map.interface.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) 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 a99d6f2669..7dfcfaea8c 100644 --- a/packages/desktop/lib/electron/processes/main.process.ts +++ b/packages/desktop/lib/electron/processes/main.process.ts @@ -267,7 +267,7 @@ export function createMainWindow(): BrowserWindow { windows.main.webContents.setWindowOpenHandler((details) => { try { - void shell.openExternal(details.url) + windows.main.webContents.send('try-open-url-in-browser', details.url) } catch (err) { console.error(err) } 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 } From 707929a4362793bdcbe77d5aac4bfa20281e93ed Mon Sep 17 00:00:00 2001 From: Jean Ribeiro Date: Wed, 21 Feb 2024 14:34:55 -0300 Subject: [PATCH 4/5] update @bloomwalletio/ui --- packages/shared/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/shared/package.json b/packages/shared/package.json index da59c94407..e8a0b304d2 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.5", "@ethereumjs/rlp": "4.0.1", "@ethereumjs/tx": "5.2.1", "@ethereumjs/util": "9.0.2", diff --git a/yarn.lock b/yarn.lock index d9f363afb6..cb5e8dff86 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.5": + version "0.20.5" + resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.20.5/544c4e0e2f62d43c695a87d8587ba105b926890e#544c4e0e2f62d43c695a87d8587ba105b926890e" + integrity sha512-10gzI8e1xeEg7ObU2HwH6IBjB8M9RfKi6A9p13JNwSD+bcpGIPrVnOUaGu9oCtBUyNSAMUwXbDE0LTV78gyNEQ== dependencies: "@floating-ui/dom" "1.4.3" "@popperjs/core" "2.11.8" From dbc33be58f443e255343ca3c5e55c4d1c9c6d607 Mon Sep 17 00:00:00 2001 From: Nicole O'Brien Date: Wed, 21 Feb 2024 22:29:55 +0000 Subject: [PATCH 5/5] chore: update ui kit --- packages/shared/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/shared/package.json b/packages/shared/package.json index e8a0b304d2..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.5", + "@bloomwalletio/ui": "0.20.6", "@ethereumjs/rlp": "4.0.1", "@ethereumjs/tx": "5.2.1", "@ethereumjs/util": "9.0.2", diff --git a/yarn.lock b/yarn.lock index cb5e8dff86..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.5": - version "0.20.5" - resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.20.5/544c4e0e2f62d43c695a87d8587ba105b926890e#544c4e0e2f62d43c695a87d8587ba105b926890e" - integrity sha512-10gzI8e1xeEg7ObU2HwH6IBjB8M9RfKi6A9p13JNwSD+bcpGIPrVnOUaGu9oCtBUyNSAMUwXbDE0LTV78gyNEQ== +"@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"