Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main -> develop #4241

Merged
merged 4 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"apps/cowswap-frontend": "1.65.0",
"apps/cowswap-frontend": "1.65.1",
"apps/explorer": "2.29.2",
"libs/permit-utils": "0.2.0",
"libs/widget-lib": "0.9.0",
"libs/widget-react": "0.7.0",
"libs/widget-lib": "0.10.0",
"libs/widget-react": "0.8.0",
"apps/widget-configurator": "1.1.0",
"libs/analytics": "1.1.0",
"libs/assets": "1.0.0",
Expand All @@ -12,7 +12,7 @@
"libs/common-utils": "1.1.0",
"libs/core": "1.0.0",
"libs/ens": "1.0.0",
"libs/events": "1.2.0",
"libs/events": "1.3.0",
"libs/snackbars": "1.0.0",
"libs/tokens": "1.1.0",
"libs/types": "1.0.0",
Expand Down
7 changes: 7 additions & 0 deletions apps/cowswap-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.65.1](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.65.0...cowswap-v1.65.1) (2024-04-15)


### Bug Fixes

* **widget:** don't reset palette state while navigating ([#4239](https://github.com/cowprotocol/cowswap/issues/4239)) ([b963bc3](https://github.com/cowprotocol/cowswap/commit/b963bc32739084e729320c49c50f51e8aed86616))

## [1.65.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.64.3...cowswap-v1.65.0) (2024-04-11)


Expand Down
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cowswap",
"version": "1.65.0",
"version": "1.65.1",
"description": "CoW Swap",
"main": "index.js",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from 'react'
import { useEffect, useState } from 'react'

import { CowSwapWidgetPaletteParams } from '@cowprotocol/widget-lib'

Expand All @@ -7,17 +7,27 @@ import { useLocation } from 'react-router-dom'
// The theme palette provided by a consumer
export function useInjectedWidgetPalette(): Partial<CowSwapWidgetPaletteParams> | undefined {
const { search } = useLocation()
const [paletteParams, setPaletteParams] = useState<CowSwapWidgetPaletteParams | undefined>(undefined)

return useMemo(() => {
useEffect(() => {
const searchParams = new URLSearchParams(search)
const palette = searchParams.get('palette')

// When the palette is not provided, then do nothing
if (!palette) return undefined

// Reset palette state when the value is null
if (palette === 'null') {
setPaletteParams(undefined)
return
}

try {
return JSON.parse(decodeURIComponent(palette))
setPaletteParams(JSON.parse(decodeURIComponent(palette)))
} catch (e) {
console.error('Failed to parse palette from URL', e)
}
}, [search])

return paletteParams
}
22 changes: 22 additions & 0 deletions libs/events/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [1.3.0](https://github.com/cowprotocol/cowswap/compare/events-v1.2.0...events-v1.3.0) (2024-04-15)


### Features

* **events:** fire on-chain transactions events ([#4045](https://github.com/cowprotocol/cowswap/issues/4045)) ([362b937](https://github.com/cowprotocol/cowswap/commit/362b9371e8d0ad09ea5501e5a58608c28eb5cf43))
* **widget:** add events module ([#3812](https://github.com/cowprotocol/cowswap/issues/3812)) ([cc3e5cc](https://github.com/cowprotocol/cowswap/commit/cc3e5ccc4c08e3e8178f4163b94ba9a0b40d349f))
* **widget:** create event emitter and typed events ([#3813](https://github.com/cowprotocol/cowswap/issues/3813)) ([f94ee16](https://github.com/cowprotocol/cowswap/commit/f94ee16167c75958f298021dad2a4e0129807ce5))
* **widget:** emit post order events ([#3819](https://github.com/cowprotocol/cowswap/issues/3819)) ([0df62ec](https://github.com/cowprotocol/cowswap/commit/0df62ec3679da1841e07f85292a5de5faab74cab))
* **widget:** implement all listeners and fix types ([#3817](https://github.com/cowprotocol/cowswap/issues/3817)) ([11a7226](https://github.com/cowprotocol/cowswap/commit/11a7226a5d3811139e784fe668ee2eebf2167a38))
* **widget:** make the event emitter global, kill react context ([#3838](https://github.com/cowprotocol/cowswap/issues/3838)) ([41e1a67](https://github.com/cowprotocol/cowswap/commit/41e1a67a74b8a26b3a02259c3fd4f88cf800d1e1))
* **widget:** misc to address issues and comments ([#3827](https://github.com/cowprotocol/cowswap/issues/3827)) ([ef83a5a](https://github.com/cowprotocol/cowswap/commit/ef83a5ad520d072ebf4f2cccde5fcfd0c1d88cd2))
* **widget:** optimise widget updates ([#3822](https://github.com/cowprotocol/cowswap/issues/3822)) ([d1a1e7d](https://github.com/cowprotocol/cowswap/commit/d1a1e7d05a1fed94dece9afbbc65f43af1a4f748))
* **widget:** post event messages to the iFrame ([#3820](https://github.com/cowprotocol/cowswap/issues/3820)) ([1c6466e](https://github.com/cowprotocol/cowswap/commit/1c6466e1b692f339746107657ec1fcbcc8934f8d))
* **widget:** subscribe to cow events (from iframe) ([#3816](https://github.com/cowprotocol/cowswap/issues/3816)) ([c3b8104](https://github.com/cowprotocol/cowswap/commit/c3b810435a6e64b12d28aac12cf785eef52f6531))


### Bug Fixes

* remove outdated transactions ([#4062](https://github.com/cowprotocol/cowswap/issues/4062)) ([9fc63ed](https://github.com/cowprotocol/cowswap/commit/9fc63ed73b6b79f3df126b2f86ccdef3d2b817df))
* **widget:** send trade params to widget integrator ([#4196](https://github.com/cowprotocol/cowswap/issues/4196)) ([0036a6b](https://github.com/cowprotocol/cowswap/commit/0036a6b3cd8ac8015a4271ea3477232d1a4e180d))

## [1.2.0](https://github.com/cowprotocol/cowswap/compare/events-v1.0.0...events-v1.2.0) (2024-04-11)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion libs/events/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/events",
"version": "1.2.0",
"version": "1.3.0",
"type": "commonjs",
"description": "CoW Swap events",
"main": "index.js",
Expand Down
35 changes: 35 additions & 0 deletions libs/widget-lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [0.10.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.9.0...widget-lib-v0.10.0) (2024-04-15)


### Features

* add option to define the base URL for the widget ([#3991](https://github.com/cowprotocol/cowswap/issues/3991)) ([6b70572](https://github.com/cowprotocol/cowswap/commit/6b7057239c137b6b80f8277fdda7d8b06a5b2ed0))
* Introduce partner fee ([#3913](https://github.com/cowprotocol/cowswap/issues/3913)) ([dbae7ed](https://github.com/cowprotocol/cowswap/commit/dbae7ed38b690b538d9fbd50e13d04bb199e3437))
* remove goerli ([#3735](https://github.com/cowprotocol/cowswap/issues/3735)) ([2eaae50](https://github.com/cowprotocol/cowswap/commit/2eaae5063f1623d03328e4c2a0fb49c7799ff0a3))
* up events lib version ([#4083](https://github.com/cowprotocol/cowswap/issues/4083)) ([02dbb0b](https://github.com/cowprotocol/cowswap/commit/02dbb0ba6f9f68a333a2fa2b78a961df4f301e36))
* update docs/learn.cow.fi URLs ([#3611](https://github.com/cowprotocol/cowswap/issues/3611)) ([af0ff6b](https://github.com/cowprotocol/cowswap/commit/af0ff6b71de422e43aab987287f780d26a17ac73))
* **widget:** add parametrization for sounds, images, and disabling/hiding features ([#3815](https://github.com/cowprotocol/cowswap/issues/3815)) ([4a6c461](https://github.com/cowprotocol/cowswap/commit/4a6c46133c98bdcffa5ebcfc66cde3bd85b23d9f))
* **widget:** create an iframe event emitter ([#3821](https://github.com/cowprotocol/cowswap/issues/3821)) ([d9d1f23](https://github.com/cowprotocol/cowswap/commit/d9d1f23c1bf90a277a0d559c019b9794e43d8162))
* **widget:** custom token lists in widget ([#3390](https://github.com/cowprotocol/cowswap/issues/3390)) ([7eabe06](https://github.com/cowprotocol/cowswap/commit/7eabe06d043703718d742809791eda555dff5058))
* **widget:** customize images ([#4159](https://github.com/cowprotocol/cowswap/issues/4159)) ([0b14b2b](https://github.com/cowprotocol/cowswap/commit/0b14b2b19279a1688f75dc4f2954b8c267e57c40))
* **widget:** emit post order events ([#3819](https://github.com/cowprotocol/cowswap/issues/3819)) ([0df62ec](https://github.com/cowprotocol/cowswap/commit/0df62ec3679da1841e07f85292a5de5faab74cab))
* **widget:** emit toast for posting orders ([#3837](https://github.com/cowprotocol/cowswap/issues/3837)) ([44749fc](https://github.com/cowprotocol/cowswap/commit/44749fc19a392bba0055c856b6990e354729f31a))
* **widget:** follow ups on issues raised ([#3840](https://github.com/cowprotocol/cowswap/issues/3840)) ([b1d621f](https://github.com/cowprotocol/cowswap/commit/b1d621f98fb1ec807b1ce5360e1f4d3d9cc50f4e))
* **widget:** implement all listeners and fix types ([#3817](https://github.com/cowprotocol/cowswap/issues/3817)) ([11a7226](https://github.com/cowprotocol/cowswap/commit/11a7226a5d3811139e784fe668ee2eebf2167a38))
* **widget:** improve JSON-RPC bridging between iFrame and provider ([#3824](https://github.com/cowprotocol/cowswap/issues/3824)) ([e9652e5](https://github.com/cowprotocol/cowswap/commit/e9652e5835d2c3ca0203349d4eae5b5874891cfc))
* **widget:** let the host app be the one connecting ([#3846](https://github.com/cowprotocol/cowswap/issues/3846)) ([05a3321](https://github.com/cowprotocol/cowswap/commit/05a3321ede220e7c07dc41df2f2f706028fc4afb))
* **widget:** misc to address issues and comments ([#3827](https://github.com/cowprotocol/cowswap/issues/3827)) ([ef83a5a](https://github.com/cowprotocol/cowswap/commit/ef83a5ad520d072ebf4f2cccde5fcfd0c1d88cd2))
* **widget:** optimise widget updates ([#3822](https://github.com/cowprotocol/cowswap/issues/3822)) ([d1a1e7d](https://github.com/cowprotocol/cowswap/commit/d1a1e7d05a1fed94dece9afbbc65f43af1a4f748))
* **widget:** option to hide safe banner ([#4175](https://github.com/cowprotocol/cowswap/issues/4175)) ([84108f4](https://github.com/cowprotocol/cowswap/commit/84108f4362333f8638d8da7c4ad4849d9f5a796c))
* **widget:** subscribe to cow events (from iframe) ([#3816](https://github.com/cowprotocol/cowswap/issues/3816)) ([c3b8104](https://github.com/cowprotocol/cowswap/commit/c3b810435a6e64b12d28aac12cf785eef52f6531))
* **widget:** use custom tokens as virtual list ([#4164](https://github.com/cowprotocol/cowswap/issues/4164)) ([8424a33](https://github.com/cowprotocol/cowswap/commit/8424a337f2ea2fd21cc3cb664d2f91facace00fb))
* **widget:** use theme colors from URL ([#4188](https://github.com/cowprotocol/cowswap/issues/4188)) ([1623b37](https://github.com/cowprotocol/cowswap/commit/1623b37a1b50499473cf82a7aa0dd8f73f63a415))


### Bug Fixes

* update widget-lib readme ([#4090](https://github.com/cowprotocol/cowswap/issues/4090)) ([014e321](https://github.com/cowprotocol/cowswap/commit/014e3210e4195c75a02f8a5e330b98d41a74149c))
* **widget:** call disconnect when destroying the widget ([#4181](https://github.com/cowprotocol/cowswap/issues/4181)) ([93a460a](https://github.com/cowprotocol/cowswap/commit/93a460a0082bc7039dea3cc5c376cc2038917966))
* **widget:** don't reset palette state while navigating ([#4239](https://github.com/cowprotocol/cowswap/issues/4239)) ([b963bc3](https://github.com/cowprotocol/cowswap/commit/b963bc32739084e729320c49c50f51e8aed86616))
* **widget:** simplify token lists config ([#3652](https://github.com/cowprotocol/cowswap/issues/3652)) ([08aacdb](https://github.com/cowprotocol/cowswap/commit/08aacdb09602f48408cfe132bb9e5440fd774063))

## [0.9.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.7.1...widget-lib-v0.9.0) (2024-04-11)

### Features
Expand Down
4 changes: 2 additions & 2 deletions libs/widget-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/widget-lib",
"version": "0.9.0",
"version": "0.10.0",
"type": "commonjs",
"description": "CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your website.",
"main": "index.js",
Expand All @@ -21,6 +21,6 @@
"widget-lib"
],
"dependencies": {
"@cowprotocol/events": "^1.2.0"
"@cowprotocol/events": "^1.2.1"
}
}
6 changes: 5 additions & 1 deletion libs/widget-lib/src/urlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ function addTradeAmountsToQuery(query: URLSearchParams, params: Partial<CowSwapW
function addThemePaletteToQuery(query: URLSearchParams, params: Partial<CowSwapWidgetParams>): URLSearchParams {
const theme = params.theme

if (!theme) return query
if (!theme) {
query.append('palette', 'null')
return query
}

if (isCowSwapWidgetPalette(theme)) {
query.append('palette', encodeURIComponent(JSON.stringify(theme)))
query.append('theme', theme.baseTheme)
} else {
query.append('palette', 'null')
query.append('theme', theme)
}

Expand Down
21 changes: 21 additions & 0 deletions libs/widget-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [0.8.0](https://github.com/cowprotocol/cowswap/compare/widget-react-v0.7.0...widget-react-v0.8.0) (2024-04-15)


### Features

* make widget to use all space ([#4197](https://github.com/cowprotocol/cowswap/issues/4197)) ([3ab6cb9](https://github.com/cowprotocol/cowswap/commit/3ab6cb98f03e571670031248af9419f301bbdaf8))
* up widget-lib version ([#4085](https://github.com/cowprotocol/cowswap/issues/4085)) ([a64efee](https://github.com/cowprotocol/cowswap/commit/a64efeec97ef3309431c19653c3e35d085bc27ff))
* **widget-react:** update widget-lib ([#3674](https://github.com/cowprotocol/cowswap/issues/3674)) ([26b4776](https://github.com/cowprotocol/cowswap/commit/26b477659a157e3c04ccac0e62907f95ad901559))
* **widget:** add error handling for React widget ([#3823](https://github.com/cowprotocol/cowswap/issues/3823)) ([dfc3e4c](https://github.com/cowprotocol/cowswap/commit/dfc3e4c8848b8d47a3858f3415959cc80972baed))
* **widget:** implement all listeners and fix types ([#3817](https://github.com/cowprotocol/cowswap/issues/3817)) ([11a7226](https://github.com/cowprotocol/cowswap/commit/11a7226a5d3811139e784fe668ee2eebf2167a38))
* **widget:** misc to address issues and comments ([#3827](https://github.com/cowprotocol/cowswap/issues/3827)) ([ef83a5a](https://github.com/cowprotocol/cowswap/commit/ef83a5ad520d072ebf4f2cccde5fcfd0c1d88cd2))
* **widget:** optimise widget updates ([#3822](https://github.com/cowprotocol/cowswap/issues/3822)) ([d1a1e7d](https://github.com/cowprotocol/cowswap/commit/d1a1e7d05a1fed94dece9afbbc65f43af1a4f748))
* **widget:** subscribe to cow events (from iframe) ([#3816](https://github.com/cowprotocol/cowswap/issues/3816)) ([c3b8104](https://github.com/cowprotocol/cowswap/commit/c3b810435a6e64b12d28aac12cf785eef52f6531))


### Bug Fixes

* connect wallet not working ([#3863](https://github.com/cowprotocol/cowswap/issues/3863)) ([b3e4eb7](https://github.com/cowprotocol/cowswap/commit/b3e4eb7b32ff946f529b08ac853da6ec094f6a19))
* minimal widget-react changes to force release-please bump ([#3776](https://github.com/cowprotocol/cowswap/issues/3776)) ([8d3d9d6](https://github.com/cowprotocol/cowswap/commit/8d3d9d691232c7cba67dbcb6f22f4581e73d012a))
* **widget:** solve issues arising when changing the provider ([#3825](https://github.com/cowprotocol/cowswap/issues/3825)) ([2f81380](https://github.com/cowprotocol/cowswap/commit/2f81380d3e2a49a63c9da4e5fedb11e378fb3c8c))

## [0.7.0](https://github.com/cowprotocol/cowswap/compare/widget-react-v0.5.0...widget-react-v0.7.0) (2024-04-11)

### Features
Expand Down
4 changes: 2 additions & 2 deletions libs/widget-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/widget-react",
"version": "0.7.0",
"version": "0.8.0",
"type": "commonjs",
"description": "CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your React application.",
"main": "index.js",
Expand All @@ -22,6 +22,6 @@
"react"
],
"dependencies": {
"@cowprotocol/widget-lib": "^0.9.0"
"@cowprotocol/widget-lib": "^0.10.0"
}
}
Loading