-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Bump Snaps packages and handle any required changes. Summary of Snaps changes: - Add support for `Address` in `Card` title - Make `fetch` responses an instance of `Response` - Add `isSecureContext` global - Use `arrayBuffer` for fetching local Snaps - Add interface persistence (unused for now) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28557?quickstart=1) --------- Co-authored-by: Guillaume Roux <[email protected]>
- Loading branch information
1 parent
4cfd133
commit 220e932
Showing
6 changed files
with
74 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,7 +233,7 @@ | |
"[email protected]": "^7.5.4", | ||
"@trezor/schema-utils@npm:1.0.2": "patch:@trezor/schema-utils@npm%3A1.0.2#~/.yarn/patches/@trezor-schema-utils-npm-1.0.2-7dd48689b2.patch", | ||
"lavamoat-core@npm:^15.1.1": "patch:lavamoat-core@npm%3A15.1.1#~/.yarn/patches/lavamoat-core-npm-15.1.1-51fbe39988.patch", | ||
"@metamask/snaps-sdk": "^6.10.0", | ||
"@metamask/snaps-sdk": "^6.11.0", | ||
"@swc/[email protected]": "^0.1.6", | ||
"@babel/core": "patch:@babel/core@npm%3A7.25.9#~/.yarn/patches/@babel-core-npm-7.25.9-4ae3bff7f3.patch", | ||
"@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", | ||
|
@@ -348,11 +348,11 @@ | |
"@metamask/selected-network-controller": "^18.0.2", | ||
"@metamask/signature-controller": "^21.1.0", | ||
"@metamask/smart-transactions-controller": "^13.0.0", | ||
"@metamask/snaps-controllers": "^9.12.0", | ||
"@metamask/snaps-execution-environments": "^6.9.2", | ||
"@metamask/snaps-controllers": "^9.13.0", | ||
"@metamask/snaps-execution-environments": "^6.10.0", | ||
"@metamask/snaps-rpc-methods": "^11.5.1", | ||
"@metamask/snaps-sdk": "^6.10.0", | ||
"@metamask/snaps-utils": "^8.5.2", | ||
"@metamask/snaps-sdk": "^6.11.0", | ||
"@metamask/snaps-utils": "^8.6.0", | ||
"@metamask/solana-wallet-snap": "^0.1.9", | ||
"@metamask/transaction-controller": "^38.3.0", | ||
"@metamask/user-operation-controller": "^13.0.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 31 additions & 10 deletions
41
ui/components/app/snaps/snap-ui-renderer/components/card.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
import { CardElement } from '@metamask/snaps-sdk/jsx'; | ||
import { mapToTemplate } from '../utils'; | ||
import { UIComponentFactory } from './types'; | ||
|
||
export const card: UIComponentFactory<CardElement> = ({ element }) => ({ | ||
element: 'SnapUICard', | ||
props: { | ||
image: element.props.image, | ||
title: element.props.title, | ||
description: element.props.description, | ||
value: element.props.value, | ||
extra: element.props.extra, | ||
}, | ||
}); | ||
export const card: UIComponentFactory<CardElement> = ({ | ||
element, | ||
...params | ||
}) => { | ||
if (typeof element.props.title !== 'string') { | ||
return { | ||
element: 'SnapUICard', | ||
props: { | ||
image: element.props.image, | ||
description: element.props.description, | ||
value: element.props.value, | ||
extra: element.props.extra, | ||
}, | ||
propComponents: { | ||
title: mapToTemplate({ element: element.props.title, ...params }), | ||
}, | ||
}; | ||
} | ||
|
||
return { | ||
element: 'SnapUICard', | ||
props: { | ||
image: element.props.image, | ||
title: element.props.title, | ||
description: element.props.description, | ||
value: element.props.value, | ||
extra: element.props.extra, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters